| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef CONTENT_BROWSER_DEVTOOLS_RENDERER_OVERRIDES_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_RENDERER_OVERRIDES_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_RENDERER_OVERRIDES_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_RENDERER_OVERRIDES_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted_memory.h" | 10 #include "base/memory/ref_counted_memory.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "cc/output/compositor_frame_metadata.h" | 14 #include "cc/output/compositor_frame_metadata.h" |
| 15 #include "content/browser/devtools/devtools_protocol.h" | 15 #include "content/browser/devtools/devtools_protocol.h" |
| 16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
| 17 | 17 |
| 18 class SkBitmap; | 18 class SkBitmap; |
| 19 | 19 |
| 20 namespace IPC { | 20 namespace IPC { |
| 21 class Message; | 21 class Message; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace content { | 24 namespace content { |
| 25 | 25 |
| 26 class DevToolsAgentHost; | |
| 27 class DevToolsTracingHandler; | 26 class DevToolsTracingHandler; |
| 28 class RenderViewHostImpl; | 27 class RenderViewHostImpl; |
| 29 | 28 |
| 30 // Overrides Inspector commands before they are sent to the renderer. | 29 // Overrides Inspector commands before they are sent to the renderer. |
| 31 // May override the implementation completely, ignore it, or handle | 30 // May override the implementation completely, ignore it, or handle |
| 32 // additional browser process implementation details. | 31 // additional browser process implementation details. |
| 33 class CONTENT_EXPORT RendererOverridesHandler | 32 class CONTENT_EXPORT RendererOverridesHandler |
| 34 : public DevToolsProtocol::Handler { | 33 : public DevToolsProtocol::Handler { |
| 35 public: | 34 public: |
| 36 explicit RendererOverridesHandler(DevToolsAgentHost* agent); | 35 RendererOverridesHandler(); |
| 37 virtual ~RendererOverridesHandler(); | 36 virtual ~RendererOverridesHandler(); |
| 38 | 37 |
| 39 void OnClientDetached(); | 38 void OnClientDetached(); |
| 40 void OnSwapCompositorFrame(const cc::CompositorFrameMetadata& frame_metadata); | 39 void OnSwapCompositorFrame(const cc::CompositorFrameMetadata& frame_metadata); |
| 41 void OnVisibilityChanged(bool visible); | 40 void OnVisibilityChanged(bool visible); |
| 42 void OnRenderViewHostChanged(); | 41 void SetRenderViewHost(RenderViewHostImpl* host); |
| 42 void ClearRenderViewHost(); |
| 43 bool OnSetTouchEventEmulationEnabled(); | 43 bool OnSetTouchEventEmulationEnabled(); |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 void InnerSwapCompositorFrame(); | 46 void InnerSwapCompositorFrame(); |
| 47 | 47 |
| 48 // DOM domain. | 48 // DOM domain. |
| 49 scoped_refptr<DevToolsProtocol::Response> | 49 scoped_refptr<DevToolsProtocol::Response> |
| 50 GrantPermissionsForSetFileInputFiles( | 50 GrantPermissionsForSetFileInputFiles( |
| 51 scoped_refptr<DevToolsProtocol::Command> command); | 51 scoped_refptr<DevToolsProtocol::Command> command); |
| 52 | 52 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 void PageQueryUsageAndQuotaCompleted( | 95 void PageQueryUsageAndQuotaCompleted( |
| 96 scoped_refptr<DevToolsProtocol::Command>, | 96 scoped_refptr<DevToolsProtocol::Command>, |
| 97 scoped_ptr<base::DictionaryValue> response_data); | 97 scoped_ptr<base::DictionaryValue> response_data); |
| 98 | 98 |
| 99 void NotifyScreencastVisibility(bool visible); | 99 void NotifyScreencastVisibility(bool visible); |
| 100 | 100 |
| 101 // Input domain. | 101 // Input domain. |
| 102 scoped_refptr<DevToolsProtocol::Response> InputEmulateTouchFromMouseEvent( | 102 scoped_refptr<DevToolsProtocol::Response> InputEmulateTouchFromMouseEvent( |
| 103 scoped_refptr<DevToolsProtocol::Command> command); | 103 scoped_refptr<DevToolsProtocol::Command> command); |
| 104 | 104 |
| 105 RenderViewHostImpl* GetRenderViewHostImpl(); | 105 RenderViewHostImpl* host_; |
| 106 | |
| 107 DevToolsAgentHost* agent_; | |
| 108 scoped_refptr<DevToolsProtocol::Command> screencast_command_; | 106 scoped_refptr<DevToolsProtocol::Command> screencast_command_; |
| 109 bool has_last_compositor_frame_metadata_; | 107 bool has_last_compositor_frame_metadata_; |
| 110 cc::CompositorFrameMetadata last_compositor_frame_metadata_; | 108 cc::CompositorFrameMetadata last_compositor_frame_metadata_; |
| 111 base::TimeTicks last_frame_time_; | 109 base::TimeTicks last_frame_time_; |
| 112 int capture_retry_count_; | 110 int capture_retry_count_; |
| 113 base::WeakPtrFactory<RendererOverridesHandler> weak_factory_; | 111 base::WeakPtrFactory<RendererOverridesHandler> weak_factory_; |
| 114 DISALLOW_COPY_AND_ASSIGN(RendererOverridesHandler); | 112 DISALLOW_COPY_AND_ASSIGN(RendererOverridesHandler); |
| 115 }; | 113 }; |
| 116 | 114 |
| 117 } // namespace content | 115 } // namespace content |
| 118 | 116 |
| 119 #endif // CONTENT_BROWSER_DEVTOOLS_RENDERER_OVERRIDES_HANDLER_H_ | 117 #endif // CONTENT_BROWSER_DEVTOOLS_RENDERER_OVERRIDES_HANDLER_H_ |
| OLD | NEW |