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

Side by Side Diff: content/renderer/devtools/devtools_agent.cc

Issue 138163016: [DevTools] Touch emulation in content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missing files added Created 6 years, 8 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
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/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view()); 240 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view());
241 impl->webview()->settings()->setForceCompositingMode(true); 241 impl->webview()->settings()->setForceCompositingMode(true);
242 impl->EnableScreenMetricsEmulation(params); 242 impl->EnableScreenMetricsEmulation(params);
243 } 243 }
244 244
245 void DevToolsAgent::disableDeviceEmulation() { 245 void DevToolsAgent::disableDeviceEmulation() {
246 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view()); 246 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view());
247 impl->DisableScreenMetricsEmulation(); 247 impl->DisableScreenMetricsEmulation();
248 } 248 }
249 249
250 void DevToolsAgent::setTouchEventEmulationEnabled(bool enabled) {
251 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view());
252 impl->Send(new ViewHostMsg_SetTouchEventEmulationEnabled(
253 impl->routing_id(), enabled));
254 }
255
250 #if defined(USE_TCMALLOC) && !defined(OS_WIN) 256 #if defined(USE_TCMALLOC) && !defined(OS_WIN)
251 static void AllocationVisitor(void* data, const void* ptr) { 257 static void AllocationVisitor(void* data, const void* ptr) {
252 typedef blink::WebDevToolsAgentClient::AllocatedObjectVisitor Visitor; 258 typedef blink::WebDevToolsAgentClient::AllocatedObjectVisitor Visitor;
253 Visitor* visitor = reinterpret_cast<Visitor*>(data); 259 Visitor* visitor = reinterpret_cast<Visitor*>(data);
254 visitor->visitObject(ptr); 260 visitor->visitObject(ptr);
255 } 261 }
256 #endif 262 #endif
257 263
258 void DevToolsAgent::visitAllocatedObjects(AllocatedObjectVisitor* visitor) { 264 void DevToolsAgent::visitAllocatedObjects(AllocatedObjectVisitor* visitor) {
259 #if defined(USE_TCMALLOC) && !defined(OS_WIN) 265 #if defined(USE_TCMALLOC) && !defined(OS_WIN)
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 if (!web_view) 365 if (!web_view)
360 return NULL; 366 return NULL;
361 return web_view->devToolsAgent(); 367 return web_view->devToolsAgent();
362 } 368 }
363 369
364 bool DevToolsAgent::IsAttached() { 370 bool DevToolsAgent::IsAttached() {
365 return is_attached_; 371 return is_attached_;
366 } 372 }
367 373
368 } // namespace content 374 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698