Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1700)

Unified Diff: content/renderer/devtools/devtools_agent.cc

Issue 1003113003: [DevTools] Handle emulation in embedder, call into web API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/devtools/devtools_agent.cc
diff --git a/content/renderer/devtools/devtools_agent.cc b/content/renderer/devtools/devtools_agent.cc
index 57f4337919356cecb1d7eba7c24b831f0af23270..5240de5760d66ee1afd80d483a775cd4479a5d70 100644
--- a/content/renderer/devtools/devtools_agent.cc
+++ b/content/renderer/devtools/devtools_agent.cc
@@ -105,6 +105,10 @@ bool DevToolsAgent::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(DevToolsAgentMsg_AddMessageToConsole,
OnAddMessageToConsole)
IPC_MESSAGE_HANDLER(DevToolsMsg_SetupDevToolsClient, OnSetupDevToolsClient)
+ IPC_MESSAGE_HANDLER(DevToolsMsg_EnableDeviceEmulation,
+ OnEnableDeviceEmulation)
+ IPC_MESSAGE_HANDLER(DevToolsMsg_DisableDeviceEmulation,
+ OnDisableDeviceEmulation)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
@@ -338,6 +342,15 @@ void DevToolsAgent::OnSetupDevToolsClient() {
new DevToolsClient(main_render_frame_);
}
+void DevToolsAgent::OnEnableDeviceEmulation(
+ const blink::WebDeviceEmulationParams& params) {
+ GetRenderViewImpl()->EnableScreenMetricsEmulation(params);
+}
+
+void DevToolsAgent::OnDisableDeviceEmulation() {
+ GetRenderViewImpl()->DisableScreenMetricsEmulation();
+}
+
WebDevToolsAgent* DevToolsAgent::GetWebAgent() {
WebView* web_view = main_render_frame_->GetRenderView()->GetWebView();
if (!web_view)

Powered by Google App Engine
This is Rietveld 408576698