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

Side by Side 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: Fix tests and mac popups compilation 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 unified diff | Download patch
« no previous file with comments | « content/renderer/devtools/devtools_agent.h ('k') | content/renderer/external_popup_menu.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/devtools/devtools_agent.h" 5 #include "content/renderer/devtools/devtools_agent.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 TraceEventCallback callback = 194 TraceEventCallback callback =
195 reinterpret_cast<TraceEventCallback>( 195 reinterpret_cast<TraceEventCallback>(
196 base::subtle::NoBarrier_Load(&event_callback_)); 196 base::subtle::NoBarrier_Load(&event_callback_));
197 if (callback) { 197 if (callback) {
198 double timestamp_seconds = (timestamp - base::TimeTicks()).InSecondsF(); 198 double timestamp_seconds = (timestamp - base::TimeTicks()).InSecondsF();
199 callback(phase, category_group_enabled, name, id, num_args, 199 callback(phase, category_group_enabled, name, id, num_args,
200 arg_names, arg_types, arg_values, flags, timestamp_seconds); 200 arg_names, arg_types, arg_values, flags, timestamp_seconds);
201 } 201 }
202 } 202 }
203 203
204 void DevToolsAgent::enableDeviceEmulation(
205 const blink::WebDeviceEmulationParams& params) {
206 GetRenderViewImpl()->EnableScreenMetricsEmulation(params);
207 }
208
209 void DevToolsAgent::disableDeviceEmulation() {
210 GetRenderViewImpl()->DisableScreenMetricsEmulation();
211 }
212
213 // static 204 // static
214 DevToolsAgent* DevToolsAgent::FromRoutingId(int routing_id) { 205 DevToolsAgent* DevToolsAgent::FromRoutingId(int routing_id) {
215 IdToAgentMap::iterator it = g_agent_for_routing_id.Get().find(routing_id); 206 IdToAgentMap::iterator it = g_agent_for_routing_id.Get().find(routing_id);
216 if (it != g_agent_for_routing_id.Get().end()) { 207 if (it != g_agent_for_routing_id.Get().end()) {
217 return it->second; 208 return it->second;
218 } 209 }
219 return NULL; 210 return NULL;
220 } 211 }
221 212
222 // static 213 // static
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 338
348 RenderViewImpl* DevToolsAgent::GetRenderViewImpl() { 339 RenderViewImpl* DevToolsAgent::GetRenderViewImpl() {
349 return static_cast<RenderViewImpl*>(main_render_frame_->GetRenderView()); 340 return static_cast<RenderViewImpl*>(main_render_frame_->GetRenderView());
350 } 341 }
351 342
352 bool DevToolsAgent::IsAttached() { 343 bool DevToolsAgent::IsAttached() {
353 return is_attached_; 344 return is_attached_;
354 } 345 }
355 346
356 } // namespace content 347 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/devtools/devtools_agent.h ('k') | content/renderer/external_popup_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698