зеркало из https://github.com/electron/electron.git
add stubs for new devtools messages
This commit is contained in:
Родитель
29ff9873f4
Коммит
705bbd31e9
|
@ -184,11 +184,21 @@ DevToolsEmbedderMessageDispatcher::CreateForDevToolsFrontend(
|
|||
d->RegisterHandler("searchInPath", &Delegate::SearchInPath, delegate);
|
||||
d->RegisterHandler("setWhitelistedShortcuts",
|
||||
&Delegate::SetWhitelistedShortcuts, delegate);
|
||||
d->RegisterHandler("setEyeDropperActive", &Delegate::SetEyeDropperActive,
|
||||
delegate);
|
||||
d->RegisterHandler("showCertificateViewer", &Delegate::ShowCertificateViewer,
|
||||
delegate);
|
||||
d->RegisterHandler("zoomIn", &Delegate::ZoomIn, delegate);
|
||||
d->RegisterHandler("zoomOut", &Delegate::ZoomOut, delegate);
|
||||
d->RegisterHandler("resetZoom", &Delegate::ResetZoom, delegate);
|
||||
d->RegisterHandler("setDevicesDiscoveryConfig",
|
||||
&Delegate::SetDevicesDiscoveryConfig, delegate);
|
||||
d->RegisterHandler("setDevicesUpdatesEnabled",
|
||||
&Delegate::SetDevicesUpdatesEnabled, delegate);
|
||||
d->RegisterHandler("performActionOnRemotePage",
|
||||
&Delegate::PerformActionOnRemotePage, delegate);
|
||||
d->RegisterHandler("openRemotePage", &Delegate::OpenRemotePage, delegate);
|
||||
d->RegisterHandler("openNodeFrontend", &Delegate::OpenNodeFrontend, delegate);
|
||||
d->RegisterHandler("dispatchProtocolMessage",
|
||||
&Delegate::DispatchProtocolMessageFromDevToolsFrontend,
|
||||
delegate);
|
||||
|
@ -199,6 +209,7 @@ DevToolsEmbedderMessageDispatcher::CreateForDevToolsFrontend(
|
|||
d->RegisterHandler("setPreference", &Delegate::SetPreference, delegate);
|
||||
d->RegisterHandler("removePreference", &Delegate::RemovePreference, delegate);
|
||||
d->RegisterHandler("clearPreferences", &Delegate::ClearPreferences, delegate);
|
||||
d->RegisterHandler("connectionReady", &Delegate::ConnectionReady, delegate);
|
||||
d->RegisterHandler("registerExtensionsAPI", &Delegate::RegisterExtensionsAPI,
|
||||
delegate);
|
||||
return d;
|
||||
|
|
|
@ -65,10 +65,23 @@ class DevToolsEmbedderMessageDispatcher {
|
|||
const std::string& file_system_path,
|
||||
const std::string& query) = 0;
|
||||
virtual void SetWhitelistedShortcuts(const std::string& message) = 0;
|
||||
virtual void SetEyeDropperActive(bool active) = 0;
|
||||
virtual void ShowCertificateViewer(const std::string& cert_chain) = 0;
|
||||
virtual void ZoomIn() = 0;
|
||||
virtual void ZoomOut() = 0;
|
||||
virtual void ResetZoom() = 0;
|
||||
virtual void SetDevicesDiscoveryConfig(
|
||||
bool discover_usb_devices,
|
||||
bool port_forwarding_enabled,
|
||||
const std::string& port_forwarding_config,
|
||||
bool network_discovery_enabled,
|
||||
const std::string& network_discovery_config) = 0;
|
||||
virtual void SetDevicesUpdatesEnabled(bool enabled) = 0;
|
||||
virtual void PerformActionOnRemotePage(const std::string& page_id,
|
||||
const std::string& action) = 0;
|
||||
virtual void OpenRemotePage(const std::string& browser_id,
|
||||
const std::string& url) = 0;
|
||||
virtual void OpenNodeFrontend() = 0;
|
||||
virtual void DispatchProtocolMessageFromDevToolsFrontend(
|
||||
const std::string& message) = 0;
|
||||
virtual void SendJsonRequest(const DispatchCallback& callback,
|
||||
|
@ -79,6 +92,7 @@ class DevToolsEmbedderMessageDispatcher {
|
|||
const std::string& value) = 0;
|
||||
virtual void RemovePreference(const std::string& name) = 0;
|
||||
virtual void ClearPreferences() = 0;
|
||||
virtual void ConnectionReady() = 0;
|
||||
virtual void RegisterExtensionsAPI(const std::string& origin,
|
||||
const std::string& script) = 0;
|
||||
};
|
||||
|
|
|
@ -552,6 +552,10 @@ void InspectableWebContentsImpl::SearchInPath(
|
|||
void InspectableWebContentsImpl::SetWhitelistedShortcuts(
|
||||
const std::string& message) {}
|
||||
|
||||
void InspectableWebContentsImpl::SetEyeDropperActive(bool active) {}
|
||||
void InspectableWebContentsImpl::ShowCertificateViewer(
|
||||
const std::string& cert_chain) {}
|
||||
|
||||
void InspectableWebContentsImpl::ZoomIn() {
|
||||
double new_level = GetNextZoomLevel(GetDevToolsZoomLevel(), false);
|
||||
SetZoomLevelForWebContents(GetDevToolsWebContents(), new_level);
|
||||
|
@ -569,8 +573,24 @@ void InspectableWebContentsImpl::ResetZoom() {
|
|||
UpdateDevToolsZoomLevel(0.);
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::SetDevicesDiscoveryConfig(
|
||||
bool discover_usb_devices,
|
||||
bool port_forwarding_enabled,
|
||||
const std::string& port_forwarding_config,
|
||||
bool network_discovery_enabled,
|
||||
const std::string& network_discovery_config) {}
|
||||
|
||||
void InspectableWebContentsImpl::SetDevicesUpdatesEnabled(bool enabled) {}
|
||||
|
||||
void InspectableWebContentsImpl::PerformActionOnRemotePage(
|
||||
const std::string& page_id,
|
||||
const std::string& action) {}
|
||||
|
||||
void InspectableWebContentsImpl::OpenRemotePage(const std::string& browser_id,
|
||||
const std::string& url) {}
|
||||
|
||||
void InspectableWebContentsImpl::OpenNodeFrontend() {}
|
||||
|
||||
void InspectableWebContentsImpl::DispatchProtocolMessageFromDevToolsFrontend(
|
||||
const std::string& message) {
|
||||
// If the devtools wants to reload the page, hijack the message and handle it
|
||||
|
@ -618,6 +638,8 @@ void InspectableWebContentsImpl::ClearPreferences() {
|
|||
update.Get()->Clear();
|
||||
}
|
||||
|
||||
void InspectableWebContentsImpl::ConnectionReady() {}
|
||||
|
||||
void InspectableWebContentsImpl::RegisterExtensionsAPI(
|
||||
const std::string& origin,
|
||||
const std::string& script) {
|
||||
|
|
|
@ -101,10 +101,23 @@ class InspectableWebContentsImpl
|
|||
const std::string& file_system_path,
|
||||
const std::string& query) override;
|
||||
void SetWhitelistedShortcuts(const std::string& message) override;
|
||||
void SetEyeDropperActive(bool active) override;
|
||||
void ShowCertificateViewer(const std::string& cert_chain) override;
|
||||
void ZoomIn() override;
|
||||
void ZoomOut() override;
|
||||
void ResetZoom() override;
|
||||
void SetDevicesDiscoveryConfig(
|
||||
bool discover_usb_devices,
|
||||
bool port_forwarding_enabled,
|
||||
const std::string& port_forwarding_config,
|
||||
bool network_discovery_enabled,
|
||||
const std::string& network_discovery_config) override;
|
||||
void SetDevicesUpdatesEnabled(bool enabled) override;
|
||||
void PerformActionOnRemotePage(const std::string& page_id,
|
||||
const std::string& action) override;
|
||||
void OpenRemotePage(const std::string& browser_id,
|
||||
const std::string& url) override;
|
||||
void OpenNodeFrontend() override;
|
||||
void DispatchProtocolMessageFromDevToolsFrontend(
|
||||
const std::string& message) override;
|
||||
void SendJsonRequest(const DispatchCallback& callback,
|
||||
|
@ -115,6 +128,7 @@ class InspectableWebContentsImpl
|
|||
const std::string& value) override;
|
||||
void RemovePreference(const std::string& name) override;
|
||||
void ClearPreferences() override;
|
||||
void ConnectionReady() override;
|
||||
void RegisterExtensionsAPI(const std::string& origin,
|
||||
const std::string& script) override;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче