Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(922)

Side by Side Diff: content/browser/devtools/protocol/page_handler.h

Issue 2817593004: [DevTools] Move eye dropper functionality from protocol to embedder (Closed)
Patch Set: rebased Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 20 matching lines...) Expand all
31 namespace content { 31 namespace content {
32 32
33 class DevToolsSession; 33 class DevToolsSession;
34 class NavigationHandle; 34 class NavigationHandle;
35 class PageNavigationThrottle; 35 class PageNavigationThrottle;
36 class RenderFrameHostImpl; 36 class RenderFrameHostImpl;
37 class WebContentsImpl; 37 class WebContentsImpl;
38 38
39 namespace protocol { 39 namespace protocol {
40 40
41 class ColorPicker;
42
43 class PageHandler : public DevToolsDomainHandler, 41 class PageHandler : public DevToolsDomainHandler,
44 public Page::Backend, 42 public Page::Backend,
45 public NotificationObserver { 43 public NotificationObserver {
46 public: 44 public:
47 PageHandler(); 45 PageHandler();
48 ~PageHandler() override; 46 ~PageHandler() override;
49 47
50 static PageHandler* FromSession(DevToolsSession* session); 48 static PageHandler* FromSession(DevToolsSession* session);
51 49
52 void Wire(UberDispatcher* dispatcher) override; 50 void Wire(UberDispatcher* dispatcher) override;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 Maybe<int> quality, 82 Maybe<int> quality,
85 Maybe<int> max_width, 83 Maybe<int> max_width,
86 Maybe<int> max_height, 84 Maybe<int> max_height,
87 Maybe<int> every_nth_frame) override; 85 Maybe<int> every_nth_frame) override;
88 Response StopScreencast() override; 86 Response StopScreencast() override;
89 Response ScreencastFrameAck(int session_id) override; 87 Response ScreencastFrameAck(int session_id) override;
90 88
91 Response HandleJavaScriptDialog(bool accept, 89 Response HandleJavaScriptDialog(bool accept,
92 Maybe<std::string> prompt_text) override; 90 Maybe<std::string> prompt_text) override;
93 91
94 Response SetColorPickerEnabled(bool enabled) override;
95 Response RequestAppBanner() override; 92 Response RequestAppBanner() override;
96 93
97 Response SetControlNavigations(bool enabled) override; 94 Response SetControlNavigations(bool enabled) override;
98 Response ProcessNavigation(const std::string& response, 95 Response ProcessNavigation(const std::string& response,
99 int navigation_id) override; 96 int navigation_id) override;
100 97
101 std::unique_ptr<PageNavigationThrottle> CreateThrottleForNavigation( 98 std::unique_ptr<PageNavigationThrottle> CreateThrottleForNavigation(
102 NavigationHandle* navigation_handle); 99 NavigationHandle* navigation_handle);
103 100
104 void OnPageNavigationThrottleDisposed(int navigation_id); 101 void OnPageNavigationThrottleDisposed(int navigation_id);
(...skipping 10 matching lines...) Expand all
115 ReadbackResponse response); 112 ReadbackResponse response);
116 void ScreencastFrameEncoded(cc::CompositorFrameMetadata metadata, 113 void ScreencastFrameEncoded(cc::CompositorFrameMetadata metadata,
117 const base::Time& timestamp, 114 const base::Time& timestamp,
118 const std::string& data); 115 const std::string& data);
119 116
120 void ScreenshotCaptured(std::unique_ptr<CaptureScreenshotCallback> callback, 117 void ScreenshotCaptured(std::unique_ptr<CaptureScreenshotCallback> callback,
121 const std::string& format, 118 const std::string& format,
122 int quality, 119 int quality,
123 const gfx::Image& image); 120 const gfx::Image& image);
124 121
125 void OnColorPicked(int r, int g, int b, int a);
126
127 // NotificationObserver overrides. 122 // NotificationObserver overrides.
128 void Observe(int type, 123 void Observe(int type,
129 const NotificationSource& source, 124 const NotificationSource& source,
130 const NotificationDetails& details) override; 125 const NotificationDetails& details) override;
131 126
132 bool enabled_; 127 bool enabled_;
133 128
134 bool screencast_enabled_; 129 bool screencast_enabled_;
135 std::string screencast_format_; 130 std::string screencast_format_;
136 int screencast_quality_; 131 int screencast_quality_;
137 int screencast_max_width_; 132 int screencast_max_width_;
138 int screencast_max_height_; 133 int screencast_max_height_;
139 int capture_every_nth_frame_; 134 int capture_every_nth_frame_;
140 int capture_retry_count_; 135 int capture_retry_count_;
141 bool has_compositor_frame_metadata_; 136 bool has_compositor_frame_metadata_;
142 cc::CompositorFrameMetadata next_compositor_frame_metadata_; 137 cc::CompositorFrameMetadata next_compositor_frame_metadata_;
143 cc::CompositorFrameMetadata last_compositor_frame_metadata_; 138 cc::CompositorFrameMetadata last_compositor_frame_metadata_;
144 int session_id_; 139 int session_id_;
145 int frame_counter_; 140 int frame_counter_;
146 int frames_in_flight_; 141 int frames_in_flight_;
147 142
148 std::unique_ptr<ColorPicker> color_picker_;
149
150 bool navigation_throttle_enabled_; 143 bool navigation_throttle_enabled_;
151 int next_navigation_id_; 144 int next_navigation_id_;
152 std::map<int, PageNavigationThrottle*> navigation_throttles_; 145 std::map<int, PageNavigationThrottle*> navigation_throttles_;
153 146
154 RenderFrameHostImpl* host_; 147 RenderFrameHostImpl* host_;
155 std::unique_ptr<Page::Frontend> frontend_; 148 std::unique_ptr<Page::Frontend> frontend_;
156 NotificationRegistrar registrar_; 149 NotificationRegistrar registrar_;
157 base::WeakPtrFactory<PageHandler> weak_factory_; 150 base::WeakPtrFactory<PageHandler> weak_factory_;
158 151
159 DISALLOW_COPY_AND_ASSIGN(PageHandler); 152 DISALLOW_COPY_AND_ASSIGN(PageHandler);
160 }; 153 };
161 154
162 } // namespace protocol 155 } // namespace protocol
163 } // namespace content 156 } // namespace content
164 157
165 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ 158 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/color_picker.cc ('k') | content/browser/devtools/protocol/page_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698