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