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

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

Issue 2132673002: Adding Navigation Throttles to DevTools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove print Created 4 years, 5 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 "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/macros.h" 11 #include "base/macros.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/protocol/devtools_protocol_dispatcher.h" 15 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h"
16 #include "content/public/browser/notification_observer.h" 16 #include "content/public/browser/notification_observer.h"
17 #include "content/public/browser/notification_registrar.h" 17 #include "content/public/browser/notification_registrar.h"
18 #include "content/public/browser/readback_types.h" 18 #include "content/public/browser/readback_types.h"
19 19
20 class SkBitmap; 20 class SkBitmap;
21 21
22 namespace content { 22 namespace content {
23 23
24 class NavigationHandle;
24 class RenderFrameHostImpl; 25 class RenderFrameHostImpl;
25 class WebContentsImpl; 26 class WebContentsImpl;
26 27
27 namespace devtools { 28 namespace devtools {
29 class PageNavigationThrottle;
30
28 namespace page { 31 namespace page {
29 32
30 class ColorPicker; 33 class ColorPicker;
31 34
32 class PageHandler : public NotificationObserver { 35 class PageHandler : public NotificationObserver {
33 public: 36 public:
34 typedef DevToolsProtocolClient::Response Response; 37 typedef DevToolsProtocolClient::Response Response;
35 38
36 PageHandler(); 39 PageHandler();
37 ~PageHandler() override; 40 ~PageHandler() override;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 Response ScreencastFrameAck(int session_id); 75 Response ScreencastFrameAck(int session_id);
73 76
74 Response HandleJavaScriptDialog(bool accept, const std::string* prompt_text); 77 Response HandleJavaScriptDialog(bool accept, const std::string* prompt_text);
75 78
76 Response QueryUsageAndQuota(DevToolsCommandId command_id, 79 Response QueryUsageAndQuota(DevToolsCommandId command_id,
77 const std::string& security_origin); 80 const std::string& security_origin);
78 81
79 Response SetColorPickerEnabled(bool enabled); 82 Response SetColorPickerEnabled(bool enabled);
80 Response RequestAppBanner(); 83 Response RequestAppBanner();
81 84
85 Response SetControlNavigations(bool enabled);
86 Response ProcessNavigation(const std::string& response, int navigation_id);
87
88 std::unique_ptr<PageNavigationThrottle> CreateThrottleForNavigation(
89 NavigationHandle* navigation_handle);
90
91 void OnPageNavigationThrottleDisposed(int navigation_id);
92 void NavigationRequested(const PageNavigationThrottle* throttle);
93
82 private: 94 private:
83 WebContentsImpl* GetWebContents(); 95 WebContentsImpl* GetWebContents();
84 void NotifyScreencastVisibility(bool visible); 96 void NotifyScreencastVisibility(bool visible);
85 void InnerSwapCompositorFrame(); 97 void InnerSwapCompositorFrame();
86 void ScreencastFrameCaptured(cc::CompositorFrameMetadata metadata, 98 void ScreencastFrameCaptured(cc::CompositorFrameMetadata metadata,
87 const SkBitmap& bitmap, 99 const SkBitmap& bitmap,
88 ReadbackResponse response); 100 ReadbackResponse response);
89 void ScreencastFrameEncoded(cc::CompositorFrameMetadata metadata, 101 void ScreencastFrameEncoded(cc::CompositorFrameMetadata metadata,
90 const base::Time& timestamp, 102 const base::Time& timestamp,
91 const std::string& data); 103 const std::string& data);
(...skipping 21 matching lines...) Expand all
113 int capture_retry_count_; 125 int capture_retry_count_;
114 bool has_compositor_frame_metadata_; 126 bool has_compositor_frame_metadata_;
115 cc::CompositorFrameMetadata next_compositor_frame_metadata_; 127 cc::CompositorFrameMetadata next_compositor_frame_metadata_;
116 cc::CompositorFrameMetadata last_compositor_frame_metadata_; 128 cc::CompositorFrameMetadata last_compositor_frame_metadata_;
117 int session_id_; 129 int session_id_;
118 int frame_counter_; 130 int frame_counter_;
119 int frames_in_flight_; 131 int frames_in_flight_;
120 132
121 std::unique_ptr<ColorPicker> color_picker_; 133 std::unique_ptr<ColorPicker> color_picker_;
122 134
135 bool navigation_throttle_enabled_;
136 int next_navigation_id_;
137 std::map<int, PageNavigationThrottle*> navigation_throttles_;
138
123 RenderFrameHostImpl* host_; 139 RenderFrameHostImpl* host_;
124 std::unique_ptr<Client> client_; 140 std::unique_ptr<Client> client_;
125 NotificationRegistrar registrar_; 141 NotificationRegistrar registrar_;
126 base::WeakPtrFactory<PageHandler> weak_factory_; 142 base::WeakPtrFactory<PageHandler> weak_factory_;
127 143
128 DISALLOW_COPY_AND_ASSIGN(PageHandler); 144 DISALLOW_COPY_AND_ASSIGN(PageHandler);
129 }; 145 };
130 146
131 } // namespace page 147 } // namespace page
132 } // namespace devtools 148 } // namespace devtools
133 } // namespace content 149 } // namespace content
134 150
135 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ 151 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_
OLDNEW
« no previous file with comments | « content/browser/devtools/protocol/devtools_protocol_browsertest.cc ('k') | content/browser/devtools/protocol/page_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698