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