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" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 NavigationEntries* entries); | 58 NavigationEntries* entries); |
59 | 59 |
60 Response NavigateToHistoryEntry(int entry_id); | 60 Response NavigateToHistoryEntry(int entry_id); |
61 | 61 |
62 Response CaptureScreenshot(DevToolsCommandId command_id); | 62 Response CaptureScreenshot(DevToolsCommandId command_id); |
63 | 63 |
64 Response CanScreencast(bool* result); | 64 Response CanScreencast(bool* result); |
65 Response StartScreencast(const std::string* format, | 65 Response StartScreencast(const std::string* format, |
66 const int* quality, | 66 const int* quality, |
67 const int* max_width, | 67 const int* max_width, |
68 const int* max_height); | 68 const int* max_height, |
| 69 const int* every_nth_frame); |
69 Response StopScreencast(); | 70 Response StopScreencast(); |
70 Response ScreencastFrameAck(int frame_number); | 71 Response ScreencastFrameAck(int frame_number); |
71 | 72 |
72 Response HandleJavaScriptDialog(bool accept, const std::string* prompt_text); | 73 Response HandleJavaScriptDialog(bool accept, const std::string* prompt_text); |
73 | 74 |
74 Response QueryUsageAndQuota(DevToolsCommandId command_id, | 75 Response QueryUsageAndQuota(DevToolsCommandId command_id, |
75 const std::string& security_origin); | 76 const std::string& security_origin); |
76 | 77 |
77 Response SetColorPickerEnabled(bool enabled); | 78 Response SetColorPickerEnabled(bool enabled); |
78 | 79 |
79 private: | 80 private: |
80 WebContentsImpl* GetWebContents(); | 81 WebContentsImpl* GetWebContents(); |
81 void NotifyScreencastVisibility(bool visible); | 82 void NotifyScreencastVisibility(bool visible); |
82 void InnerSwapCompositorFrame(); | 83 void InnerSwapCompositorFrame(); |
83 void ScreencastFrameCaptured(const cc::CompositorFrameMetadata& metadata, | 84 void ScreencastFrameCaptured(const cc::CompositorFrameMetadata& metadata, |
| 85 int frame_number, |
84 const SkBitmap& bitmap, | 86 const SkBitmap& bitmap, |
85 ReadbackResponse response); | 87 ReadbackResponse response); |
86 void ScreencastFrameEncoded(const cc::CompositorFrameMetadata& metadata, | 88 void ScreencastFrameEncoded(const cc::CompositorFrameMetadata& metadata, |
| 89 int frame_number, |
87 const base::Time& timestamp, | 90 const base::Time& timestamp, |
88 const std::string& data); | 91 const std::string& data); |
89 | 92 |
90 void ScreenshotCaptured( | 93 void ScreenshotCaptured( |
91 DevToolsCommandId command_id, | 94 DevToolsCommandId command_id, |
92 const unsigned char* png_data, | 95 const unsigned char* png_data, |
93 size_t png_size); | 96 size_t png_size); |
94 | 97 |
95 void OnColorPicked(int r, int g, int b, int a); | 98 void OnColorPicked(int r, int g, int b, int a); |
96 | 99 |
97 // NotificationObserver overrides. | 100 // NotificationObserver overrides. |
98 void Observe(int type, | 101 void Observe(int type, |
99 const NotificationSource& source, | 102 const NotificationSource& source, |
100 const NotificationDetails& details) override; | 103 const NotificationDetails& details) override; |
101 | 104 |
102 bool enabled_; | 105 bool enabled_; |
103 | 106 |
104 bool screencast_enabled_; | 107 bool screencast_enabled_; |
105 std::string screencast_format_; | 108 std::string screencast_format_; |
106 int screencast_quality_; | 109 int screencast_quality_; |
107 int screencast_max_width_; | 110 int screencast_max_width_; |
108 int screencast_max_height_; | 111 int screencast_max_height_; |
| 112 int capture_every_nth_frame_; |
109 int capture_retry_count_; | 113 int capture_retry_count_; |
110 bool has_compositor_frame_metadata_; | 114 bool has_compositor_frame_metadata_; |
111 cc::CompositorFrameMetadata next_compositor_frame_metadata_; | 115 cc::CompositorFrameMetadata next_compositor_frame_metadata_; |
112 cc::CompositorFrameMetadata last_compositor_frame_metadata_; | 116 cc::CompositorFrameMetadata last_compositor_frame_metadata_; |
113 int screencast_frame_sent_; | 117 int screencast_frame_sent_; |
114 int screencast_frame_acked_; | 118 int screencast_frame_acked_; |
115 bool processing_screencast_frame_; | |
116 | 119 |
117 scoped_ptr<ColorPicker> color_picker_; | 120 scoped_ptr<ColorPicker> color_picker_; |
118 | 121 |
119 RenderFrameHostImpl* host_; | 122 RenderFrameHostImpl* host_; |
120 scoped_ptr<Client> client_; | 123 scoped_ptr<Client> client_; |
121 NotificationRegistrar registrar_; | 124 NotificationRegistrar registrar_; |
122 base::WeakPtrFactory<PageHandler> weak_factory_; | 125 base::WeakPtrFactory<PageHandler> weak_factory_; |
123 | 126 |
124 DISALLOW_COPY_AND_ASSIGN(PageHandler); | 127 DISALLOW_COPY_AND_ASSIGN(PageHandler); |
125 }; | 128 }; |
126 | 129 |
127 } // namespace page | 130 } // namespace page |
128 } // namespace devtools | 131 } // namespace devtools |
129 } // namespace content | 132 } // namespace content |
130 | 133 |
131 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ | 134 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ |
OLD | NEW |