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

Side by Side Diff: content/browser/devtools/render_view_devtools_agent_host.cc

Issue 474213002: DevTools: control touch emulation from the browser side only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebaselined Created 6 years, 4 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 | Annotate | Revision Log
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/browser/devtools/render_view_devtools_agent_host.h" 5 #include "content/browser/devtools/render_view_devtools_agent_host.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "content/browser/child_process_security_policy_impl.h" 9 #include "content/browser/child_process_security_policy_impl.h"
10 #include "content/browser/devtools/devtools_manager_impl.h" 10 #include "content/browser/devtools/devtools_manager_impl.h"
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 return false; 396 return false;
397 397
398 bool handled = true; 398 bool handled = true;
399 IPC_BEGIN_MESSAGE_MAP(RenderViewDevToolsAgentHost, msg) 399 IPC_BEGIN_MESSAGE_MAP(RenderViewDevToolsAgentHost, msg)
400 IPC_MESSAGE_HANDLER(DevToolsClientMsg_DispatchOnInspectorFrontend, 400 IPC_MESSAGE_HANDLER(DevToolsClientMsg_DispatchOnInspectorFrontend,
401 OnDispatchOnInspectorFrontend) 401 OnDispatchOnInspectorFrontend)
402 IPC_MESSAGE_HANDLER(DevToolsHostMsg_SaveAgentRuntimeState, 402 IPC_MESSAGE_HANDLER(DevToolsHostMsg_SaveAgentRuntimeState,
403 OnSaveAgentRuntimeState) 403 OnSaveAgentRuntimeState)
404 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame, 404 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SwapCompositorFrame,
405 handled = false; OnSwapCompositorFrame(msg)) 405 handled = false; OnSwapCompositorFrame(msg))
406 IPC_MESSAGE_HANDLER_GENERIC(ViewHostMsg_SetTouchEventEmulationEnabled,
407 handled = OnSetTouchEventEmulationEnabled(msg))
408 IPC_MESSAGE_UNHANDLED(handled = false) 406 IPC_MESSAGE_UNHANDLED(handled = false)
409 IPC_END_MESSAGE_MAP() 407 IPC_END_MESSAGE_MAP()
410 return handled; 408 return handled;
411 } 409 }
412 410
413 void RenderViewDevToolsAgentHost::OnSwapCompositorFrame( 411 void RenderViewDevToolsAgentHost::OnSwapCompositorFrame(
414 const IPC::Message& message) { 412 const IPC::Message& message) {
415 ViewHostMsg_SwapCompositorFrame::Param param; 413 ViewHostMsg_SwapCompositorFrame::Param param;
416 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, &param)) 414 if (!ViewHostMsg_SwapCompositorFrame::Read(&message, &param))
417 return; 415 return;
418 overrides_handler_->OnSwapCompositorFrame(param.b.metadata); 416 overrides_handler_->OnSwapCompositorFrame(param.b.metadata);
419 } 417 }
420 418
421 bool RenderViewDevToolsAgentHost::OnSetTouchEventEmulationEnabled(
422 const IPC::Message& message) {
423 return overrides_handler_->OnSetTouchEventEmulationEnabled();
424 }
425
426 void RenderViewDevToolsAgentHost::SynchronousSwapCompositorFrame( 419 void RenderViewDevToolsAgentHost::SynchronousSwapCompositorFrame(
427 const cc::CompositorFrameMetadata& frame_metadata) { 420 const cc::CompositorFrameMetadata& frame_metadata) {
428 if (!render_view_host_) 421 if (!render_view_host_)
429 return; 422 return;
430 overrides_handler_->OnSwapCompositorFrame(frame_metadata); 423 overrides_handler_->OnSwapCompositorFrame(frame_metadata);
431 } 424 }
432 425
433 void RenderViewDevToolsAgentHost::OnSaveAgentRuntimeState( 426 void RenderViewDevToolsAgentHost::OnSaveAgentRuntimeState(
434 const std::string& state) { 427 const std::string& state) {
435 if (!render_view_host_) 428 if (!render_view_host_)
(...skipping 10 matching lines...) Expand all
446 DevToolsProtocol::ParseNotification(message); 439 DevToolsProtocol::ParseNotification(message);
447 440
448 if (notification) { 441 if (notification) {
449 tracing_handler_->HandleNotification(notification); 442 tracing_handler_->HandleNotification(notification);
450 } 443 }
451 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend( 444 DevToolsManagerImpl::GetInstance()->DispatchOnInspectorFrontend(
452 this, message); 445 this, message);
453 } 446 }
454 447
455 } // namespace content 448 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698