| 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 |
| 254 #if defined(USE_TCMALLOC) && !defined(OS_WIN) | 261 #if defined(USE_TCMALLOC) && !defined(OS_WIN) |
| 255 static void AllocationVisitor(void* data, const void* ptr) { | 262 static void AllocationVisitor(void* data, const void* ptr) { |
| 256 typedef blink::WebDevToolsAgentClient::AllocatedObjectVisitor Visitor; | 263 typedef blink::WebDevToolsAgentClient::AllocatedObjectVisitor Visitor; |
| 257 Visitor* visitor = reinterpret_cast<Visitor*>(data); | 264 Visitor* visitor = reinterpret_cast<Visitor*>(data); |
| 258 visitor->visitObject(ptr); | 265 visitor->visitObject(ptr); |
| 259 } | 266 } |
| 260 #endif | 267 #endif |
| 261 | 268 |
| 262 void DevToolsAgent::visitAllocatedObjects(AllocatedObjectVisitor* visitor) { | 269 void DevToolsAgent::visitAllocatedObjects(AllocatedObjectVisitor* visitor) { |
| 263 #if defined(USE_TCMALLOC) && !defined(OS_WIN) | 270 #if defined(USE_TCMALLOC) && !defined(OS_WIN) |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 if (!web_view) | 370 if (!web_view) |
| 364 return NULL; | 371 return NULL; |
| 365 return web_view->devToolsAgent(); | 372 return web_view->devToolsAgent(); |
| 366 } | 373 } |
| 367 | 374 |
| 368 bool DevToolsAgent::IsAttached() { | 375 bool DevToolsAgent::IsAttached() { |
| 369 return is_attached_; | 376 return is_attached_; |
| 370 } | 377 } |
| 371 | 378 |
| 372 } // namespace content | 379 } // namespace content |
| OLD | NEW |