OLD | NEW |
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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view()); | 244 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view()); |
245 impl->webview()->settings()->setForceCompositingMode(true); | 245 impl->webview()->settings()->setForceCompositingMode(true); |
246 impl->EnableScreenMetricsEmulation(params); | 246 impl->EnableScreenMetricsEmulation(params); |
247 } | 247 } |
248 | 248 |
249 void DevToolsAgent::disableDeviceEmulation() { | 249 void DevToolsAgent::disableDeviceEmulation() { |
250 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view()); | 250 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view()); |
251 impl->DisableScreenMetricsEmulation(); | 251 impl->DisableScreenMetricsEmulation(); |
252 } | 252 } |
253 | 253 |
254 void DevToolsAgent::setTouchEventEmulationEnabled( | |
255 bool enabled, bool allow_pinch) { | |
256 RenderViewImpl* impl = static_cast<RenderViewImpl*>(render_view()); | |
257 impl->Send(new ViewHostMsg_SetTouchEventEmulationEnabled( | |
258 impl->routing_id(), enabled, allow_pinch)); | |
259 } | |
260 | |
261 #if defined(USE_TCMALLOC) && !defined(OS_WIN) | 254 #if defined(USE_TCMALLOC) && !defined(OS_WIN) |
262 static void AllocationVisitor(void* data, const void* ptr) { | 255 static void AllocationVisitor(void* data, const void* ptr) { |
263 typedef blink::WebDevToolsAgentClient::AllocatedObjectVisitor Visitor; | 256 typedef blink::WebDevToolsAgentClient::AllocatedObjectVisitor Visitor; |
264 Visitor* visitor = reinterpret_cast<Visitor*>(data); | 257 Visitor* visitor = reinterpret_cast<Visitor*>(data); |
265 visitor->visitObject(ptr); | 258 visitor->visitObject(ptr); |
266 } | 259 } |
267 #endif | 260 #endif |
268 | 261 |
269 void DevToolsAgent::visitAllocatedObjects(AllocatedObjectVisitor* visitor) { | 262 void DevToolsAgent::visitAllocatedObjects(AllocatedObjectVisitor* visitor) { |
270 #if defined(USE_TCMALLOC) && !defined(OS_WIN) | 263 #if defined(USE_TCMALLOC) && !defined(OS_WIN) |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 if (!web_view) | 363 if (!web_view) |
371 return NULL; | 364 return NULL; |
372 return web_view->devToolsAgent(); | 365 return web_view->devToolsAgent(); |
373 } | 366 } |
374 | 367 |
375 bool DevToolsAgent::IsAttached() { | 368 bool DevToolsAgent::IsAttached() { |
376 return is_attached_; | 369 return is_attached_; |
377 } | 370 } |
378 | 371 |
379 } // namespace content | 372 } // namespace content |
OLD | NEW |