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 <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_domain_handler.h" |
15 #include "content/browser/devtools/protocol/page.h" | 16 #include "content/browser/devtools/protocol/page.h" |
16 #include "content/public/browser/notification_observer.h" | 17 #include "content/public/browser/notification_observer.h" |
17 #include "content/public/browser/notification_registrar.h" | 18 #include "content/public/browser/notification_registrar.h" |
18 #include "content/public/browser/readback_types.h" | 19 #include "content/public/browser/readback_types.h" |
19 | 20 |
20 class SkBitmap; | 21 class SkBitmap; |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 | 24 |
| 25 class DevToolsSession; |
24 class NavigationHandle; | 26 class NavigationHandle; |
25 class PageNavigationThrottle; | 27 class PageNavigationThrottle; |
26 class RenderFrameHostImpl; | 28 class RenderFrameHostImpl; |
27 class WebContentsImpl; | 29 class WebContentsImpl; |
28 | 30 |
29 namespace protocol { | 31 namespace protocol { |
30 | 32 |
31 class ColorPicker; | 33 class ColorPicker; |
32 | 34 |
33 class PageHandler : public Page::Backend, | 35 class PageHandler : public DevToolsDomainHandler, |
| 36 public Page::Backend, |
34 public NotificationObserver { | 37 public NotificationObserver { |
35 public: | 38 public: |
36 PageHandler(); | 39 PageHandler(); |
37 ~PageHandler() override; | 40 ~PageHandler() override; |
38 | 41 |
39 void Wire(UberDispatcher*); | 42 static PageHandler* FromSession(DevToolsSession* session); |
40 void SetRenderFrameHost(RenderFrameHostImpl* host); | 43 |
| 44 void Wire(UberDispatcher* dispatcher) override; |
| 45 void SetRenderFrameHost(RenderFrameHostImpl* host) override; |
41 void OnSwapCompositorFrame(cc::CompositorFrameMetadata frame_metadata); | 46 void OnSwapCompositorFrame(cc::CompositorFrameMetadata frame_metadata); |
42 void OnSynchronousSwapCompositorFrame( | 47 void OnSynchronousSwapCompositorFrame( |
43 cc::CompositorFrameMetadata frame_metadata); | 48 cc::CompositorFrameMetadata frame_metadata); |
44 void DidAttachInterstitialPage(); | 49 void DidAttachInterstitialPage(); |
45 void DidDetachInterstitialPage(); | 50 void DidDetachInterstitialPage(); |
46 bool screencast_enabled() const { return enabled_ && screencast_enabled_; } | 51 bool screencast_enabled() const { return enabled_ && screencast_enabled_; } |
47 | 52 |
48 Response Enable() override; | 53 Response Enable() override; |
49 Response Disable() override; | 54 Response Disable() override; |
50 | 55 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 NotificationRegistrar registrar_; | 140 NotificationRegistrar registrar_; |
136 base::WeakPtrFactory<PageHandler> weak_factory_; | 141 base::WeakPtrFactory<PageHandler> weak_factory_; |
137 | 142 |
138 DISALLOW_COPY_AND_ASSIGN(PageHandler); | 143 DISALLOW_COPY_AND_ASSIGN(PageHandler); |
139 }; | 144 }; |
140 | 145 |
141 } // namespace protocol | 146 } // namespace protocol |
142 } // namespace content | 147 } // namespace content |
143 | 148 |
144 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ | 149 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ |
OLD | NEW |