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 #include "third_party/skia/include/core/SkBitmap.h" |
17 | 18 |
18 class SkBitmap; | 19 class SkBitmap; |
19 | 20 |
20 namespace IPC { | 21 namespace IPC { |
21 class Message; | 22 class Message; |
22 } | 23 } |
23 | 24 |
| 25 namespace blink { |
| 26 class WebMouseEvent; |
| 27 } |
| 28 |
24 namespace content { | 29 namespace content { |
25 | 30 |
26 class DevToolsAgentHost; | 31 class DevToolsAgentHost; |
27 class DevToolsTracingHandler; | 32 class DevToolsTracingHandler; |
28 class RenderViewHostImpl; | 33 class RenderViewHostImpl; |
29 | 34 |
30 // Overrides Inspector commands before they are sent to the renderer. | 35 // Overrides Inspector commands before they are sent to the renderer. |
31 // May override the implementation completely, ignore it, or handle | 36 // May override the implementation completely, ignore it, or handle |
32 // additional browser process implementation details. | 37 // additional browser process implementation details. |
33 class CONTENT_EXPORT RendererOverridesHandler | 38 class CONTENT_EXPORT RendererOverridesHandler |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 scoped_refptr<DevToolsProtocol::Response> PageCaptureScreenshot( | 77 scoped_refptr<DevToolsProtocol::Response> PageCaptureScreenshot( |
73 scoped_refptr<DevToolsProtocol::Command> command); | 78 scoped_refptr<DevToolsProtocol::Command> command); |
74 scoped_refptr<DevToolsProtocol::Response> PageCanScreencast( | 79 scoped_refptr<DevToolsProtocol::Response> PageCanScreencast( |
75 scoped_refptr<DevToolsProtocol::Command> command); | 80 scoped_refptr<DevToolsProtocol::Command> command); |
76 scoped_refptr<DevToolsProtocol::Response> PageStartScreencast( | 81 scoped_refptr<DevToolsProtocol::Response> PageStartScreencast( |
77 scoped_refptr<DevToolsProtocol::Command> command); | 82 scoped_refptr<DevToolsProtocol::Command> command); |
78 scoped_refptr<DevToolsProtocol::Response> PageStopScreencast( | 83 scoped_refptr<DevToolsProtocol::Response> PageStopScreencast( |
79 scoped_refptr<DevToolsProtocol::Command> command); | 84 scoped_refptr<DevToolsProtocol::Command> command); |
80 scoped_refptr<DevToolsProtocol::Response> PageQueryUsageAndQuota( | 85 scoped_refptr<DevToolsProtocol::Response> PageQueryUsageAndQuota( |
81 scoped_refptr<DevToolsProtocol::Command>); | 86 scoped_refptr<DevToolsProtocol::Command>); |
| 87 scoped_refptr<DevToolsProtocol::Response> PageSetColorPickerEnabled( |
| 88 scoped_refptr<DevToolsProtocol::Command>); |
82 | 89 |
83 void ScreenshotCaptured( | 90 void ScreenshotCaptured( |
84 scoped_refptr<DevToolsProtocol::Command> command, | 91 scoped_refptr<DevToolsProtocol::Command> command, |
85 const unsigned char* png_data, | 92 const unsigned char* png_data, |
86 size_t png_size); | 93 size_t png_size); |
87 | 94 |
88 void ScreencastFrameCaptured( | 95 void ScreencastFrameCaptured( |
89 const std::string& format, | 96 const std::string& format, |
90 int quality, | 97 int quality, |
91 const cc::CompositorFrameMetadata& metadata, | 98 const cc::CompositorFrameMetadata& metadata, |
92 bool success, | 99 bool success, |
93 const SkBitmap& bitmap); | 100 const SkBitmap& bitmap); |
94 | 101 |
95 void PageQueryUsageAndQuotaCompleted( | 102 void PageQueryUsageAndQuotaCompleted( |
96 scoped_refptr<DevToolsProtocol::Command>, | 103 scoped_refptr<DevToolsProtocol::Command>, |
97 scoped_ptr<base::DictionaryValue> response_data); | 104 scoped_ptr<base::DictionaryValue> response_data); |
98 | 105 |
99 void NotifyScreencastVisibility(bool visible); | 106 void NotifyScreencastVisibility(bool visible); |
| 107 void SetColorPickerEnabled(bool enabled); |
| 108 void UpdateColorPickerFrame(); |
| 109 void ColorPickerFrameUpdated(bool succeeded, const SkBitmap& bitmap); |
| 110 void HandleMouseEvent(const blink::WebMouseEvent& event); |
100 | 111 |
101 // Input domain. | 112 // Input domain. |
102 scoped_refptr<DevToolsProtocol::Response> InputEmulateTouchFromMouseEvent( | 113 scoped_refptr<DevToolsProtocol::Response> InputEmulateTouchFromMouseEvent( |
103 scoped_refptr<DevToolsProtocol::Command> command); | 114 scoped_refptr<DevToolsProtocol::Command> command); |
104 | 115 |
105 RenderViewHostImpl* GetRenderViewHostImpl(); | 116 RenderViewHostImpl* GetRenderViewHostImpl(); |
106 | 117 |
107 DevToolsAgentHost* agent_; | 118 DevToolsAgentHost* agent_; |
108 scoped_refptr<DevToolsProtocol::Command> screencast_command_; | 119 scoped_refptr<DevToolsProtocol::Command> screencast_command_; |
109 bool has_last_compositor_frame_metadata_; | 120 bool has_last_compositor_frame_metadata_; |
110 cc::CompositorFrameMetadata last_compositor_frame_metadata_; | 121 cc::CompositorFrameMetadata last_compositor_frame_metadata_; |
111 base::TimeTicks last_frame_time_; | 122 base::TimeTicks last_frame_time_; |
112 int capture_retry_count_; | 123 int capture_retry_count_; |
| 124 bool color_picker_enabled_; |
| 125 SkBitmap color_picker_frame_; |
113 base::WeakPtrFactory<RendererOverridesHandler> weak_factory_; | 126 base::WeakPtrFactory<RendererOverridesHandler> weak_factory_; |
114 DISALLOW_COPY_AND_ASSIGN(RendererOverridesHandler); | 127 DISALLOW_COPY_AND_ASSIGN(RendererOverridesHandler); |
115 }; | 128 }; |
116 | 129 |
117 } // namespace content | 130 } // namespace content |
118 | 131 |
119 #endif // CONTENT_BROWSER_DEVTOOLS_RENDERER_OVERRIDES_HANDLER_H_ | 132 #endif // CONTENT_BROWSER_DEVTOOLS_RENDERER_OVERRIDES_HANDLER_H_ |
OLD | NEW |