| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PROTOCOL_PAGE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_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/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "cc/output/compositor_frame_metadata.h" | 12 #include "cc/output/compositor_frame_metadata.h" |
| 13 #include "content/browser/devtools/protocol/devtools_protocol_handler.h" | 13 #include "content/browser/devtools/protocol/devtools_protocol_handler.h" |
| 14 #include "content/public/browser/readback_types.h" | 14 #include "content/public/browser/readback_types.h" |
| 15 #include "third_party/WebKit/public/web/WebDeviceEmulationParams.h" |
| 15 | 16 |
| 16 class SkBitmap; | 17 class SkBitmap; |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 | 20 |
| 20 class RenderViewHostImpl; | 21 class RenderViewHostImpl; |
| 21 | 22 |
| 22 namespace devtools { | 23 namespace devtools { |
| 23 namespace page { | 24 namespace page { |
| 24 | 25 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 93 |
| 93 Response HandleJavaScriptDialog(bool accept, const std::string* prompt_text); | 94 Response HandleJavaScriptDialog(bool accept, const std::string* prompt_text); |
| 94 | 95 |
| 95 Response QueryUsageAndQuota(DevToolsCommandId command_id, | 96 Response QueryUsageAndQuota(DevToolsCommandId command_id, |
| 96 const std::string& security_origin); | 97 const std::string& security_origin); |
| 97 | 98 |
| 98 Response SetColorPickerEnabled(bool enabled); | 99 Response SetColorPickerEnabled(bool enabled); |
| 99 | 100 |
| 100 private: | 101 private: |
| 101 void UpdateTouchEventEmulationState(); | 102 void UpdateTouchEventEmulationState(); |
| 103 void UpdateDeviceEmulationState(); |
| 102 | 104 |
| 103 void NotifyScreencastVisibility(bool visible); | 105 void NotifyScreencastVisibility(bool visible); |
| 104 void InnerSwapCompositorFrame(); | 106 void InnerSwapCompositorFrame(); |
| 105 void ScreencastFrameCaptured(const cc::CompositorFrameMetadata& metadata, | 107 void ScreencastFrameCaptured(const cc::CompositorFrameMetadata& metadata, |
| 106 const SkBitmap& bitmap, | 108 const SkBitmap& bitmap, |
| 107 ReadbackResponse response); | 109 ReadbackResponse response); |
| 108 void ScreencastFrameEncoded(const cc::CompositorFrameMetadata& metadata, | 110 void ScreencastFrameEncoded(const cc::CompositorFrameMetadata& metadata, |
| 109 const base::Time& timestamp, | 111 const base::Time& timestamp, |
| 110 const std::string& data); | 112 const std::string& data); |
| 111 | 113 |
| 112 void ScreenshotCaptured( | 114 void ScreenshotCaptured( |
| 113 DevToolsCommandId command_id, | 115 DevToolsCommandId command_id, |
| 114 const unsigned char* png_data, | 116 const unsigned char* png_data, |
| 115 size_t png_size); | 117 size_t png_size); |
| 116 | 118 |
| 117 void OnColorPicked(int r, int g, int b, int a); | 119 void OnColorPicked(int r, int g, int b, int a); |
| 118 void OnFramesRecorded( | 120 void OnFramesRecorded( |
| 119 DevToolsCommandId command_id, | 121 DevToolsCommandId command_id, |
| 120 scoped_refptr<StopRecordingFramesResponse> response_data); | 122 scoped_refptr<StopRecordingFramesResponse> response_data); |
| 121 | 123 |
| 122 bool enabled_; | 124 bool enabled_; |
| 125 |
| 123 bool touch_emulation_enabled_; | 126 bool touch_emulation_enabled_; |
| 124 std::string touch_emulation_configuration_; | 127 std::string touch_emulation_configuration_; |
| 125 | 128 |
| 129 bool device_emulation_enabled_; |
| 130 blink::WebDeviceEmulationParams device_emulation_params_; |
| 131 |
| 126 bool screencast_enabled_; | 132 bool screencast_enabled_; |
| 127 std::string screencast_format_; | 133 std::string screencast_format_; |
| 128 int screencast_quality_; | 134 int screencast_quality_; |
| 129 int screencast_max_width_; | 135 int screencast_max_width_; |
| 130 int screencast_max_height_; | 136 int screencast_max_height_; |
| 131 int capture_retry_count_; | 137 int capture_retry_count_; |
| 132 bool has_compositor_frame_metadata_; | 138 bool has_compositor_frame_metadata_; |
| 133 cc::CompositorFrameMetadata next_compositor_frame_metadata_; | 139 cc::CompositorFrameMetadata next_compositor_frame_metadata_; |
| 134 cc::CompositorFrameMetadata last_compositor_frame_metadata_; | 140 cc::CompositorFrameMetadata last_compositor_frame_metadata_; |
| 135 int screencast_frame_sent_; | 141 int screencast_frame_sent_; |
| 136 int screencast_frame_acked_; | 142 int screencast_frame_acked_; |
| 137 bool processing_screencast_frame_; | 143 bool processing_screencast_frame_; |
| 138 | 144 |
| 139 scoped_ptr<ColorPicker> color_picker_; | 145 scoped_ptr<ColorPicker> color_picker_; |
| 140 scoped_ptr<FrameRecorder> frame_recorder_; | 146 scoped_ptr<FrameRecorder> frame_recorder_; |
| 141 | 147 |
| 142 RenderViewHostImpl* host_; | 148 RenderViewHostImpl* host_; |
| 143 scoped_ptr<Client> client_; | 149 scoped_ptr<Client> client_; |
| 144 base::WeakPtrFactory<PageHandler> weak_factory_; | 150 base::WeakPtrFactory<PageHandler> weak_factory_; |
| 145 | 151 |
| 146 DISALLOW_COPY_AND_ASSIGN(PageHandler); | 152 DISALLOW_COPY_AND_ASSIGN(PageHandler); |
| 147 }; | 153 }; |
| 148 | 154 |
| 149 } // namespace page | 155 } // namespace page |
| 150 } // namespace devtools | 156 } // namespace devtools |
| 151 } // namespace content | 157 } // namespace content |
| 152 | 158 |
| 153 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ | 159 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ |
| OLD | NEW |