| 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 <map> |
| 11 #include <memory> |
| 12 #include <string> |
| 13 |
| 10 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 15 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
| 13 #include "base/time/time.h" | 17 #include "base/time/time.h" |
| 14 #include "cc/output/compositor_frame_metadata.h" | 18 #include "cc/output/compositor_frame_metadata.h" |
| 15 #include "content/browser/devtools/protocol/devtools_domain_handler.h" | 19 #include "content/browser/devtools/protocol/devtools_domain_handler.h" |
| 16 #include "content/browser/devtools/protocol/page.h" | 20 #include "content/browser/devtools/protocol/page.h" |
| 17 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 22 #include "content/public/browser/notification_registrar.h" |
| 19 #include "content/public/browser/readback_types.h" | 23 #include "content/public/browser/readback_types.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 70 |
| 67 using NavigationEntries = protocol::Array<Page::NavigationEntry>; | 71 using NavigationEntries = protocol::Array<Page::NavigationEntry>; |
| 68 Response GetNavigationHistory( | 72 Response GetNavigationHistory( |
| 69 int* current_index, | 73 int* current_index, |
| 70 std::unique_ptr<NavigationEntries>* entries) override; | 74 std::unique_ptr<NavigationEntries>* entries) override; |
| 71 Response NavigateToHistoryEntry(int entry_id) override; | 75 Response NavigateToHistoryEntry(int entry_id) override; |
| 72 | 76 |
| 73 void CaptureScreenshot( | 77 void CaptureScreenshot( |
| 74 Maybe<std::string> format, | 78 Maybe<std::string> format, |
| 75 Maybe<int> quality, | 79 Maybe<int> quality, |
| 80 Maybe<bool> from_surface, |
| 76 std::unique_ptr<CaptureScreenshotCallback> callback) override; | 81 std::unique_ptr<CaptureScreenshotCallback> callback) override; |
| 77 void PrintToPDF(std::unique_ptr<PrintToPDFCallback> callback) override; | 82 void PrintToPDF(std::unique_ptr<PrintToPDFCallback> callback) override; |
| 78 Response StartScreencast(Maybe<std::string> format, | 83 Response StartScreencast(Maybe<std::string> format, |
| 79 Maybe<int> quality, | 84 Maybe<int> quality, |
| 80 Maybe<int> max_width, | 85 Maybe<int> max_width, |
| 81 Maybe<int> max_height, | 86 Maybe<int> max_height, |
| 82 Maybe<int> every_nth_frame) override; | 87 Maybe<int> every_nth_frame) override; |
| 83 Response StopScreencast() override; | 88 Response StopScreencast() override; |
| 84 Response ScreencastFrameAck(int session_id) override; | 89 Response ScreencastFrameAck(int session_id) override; |
| 85 | 90 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 110 ReadbackResponse response); | 115 ReadbackResponse response); |
| 111 void ScreencastFrameEncoded(cc::CompositorFrameMetadata metadata, | 116 void ScreencastFrameEncoded(cc::CompositorFrameMetadata metadata, |
| 112 const base::Time& timestamp, | 117 const base::Time& timestamp, |
| 113 const std::string& data); | 118 const std::string& data); |
| 114 | 119 |
| 115 void ScreenshotCaptured(std::unique_ptr<CaptureScreenshotCallback> callback, | 120 void ScreenshotCaptured(std::unique_ptr<CaptureScreenshotCallback> callback, |
| 116 const std::string& format, | 121 const std::string& format, |
| 117 int quality, | 122 int quality, |
| 118 const gfx::Image& image); | 123 const gfx::Image& image); |
| 119 | 124 |
| 125 void ScreenshotFromSurfaceCaptured( |
| 126 std::unique_ptr<CaptureScreenshotCallback> callback, |
| 127 const std::string& format, |
| 128 int quality, |
| 129 const SkBitmap& bitmap); |
| 130 |
| 131 void ScreenshotFromSurfaceEncoded( |
| 132 std::unique_ptr<CaptureScreenshotCallback> callback, |
| 133 const std::string& data); |
| 134 |
| 120 void OnColorPicked(int r, int g, int b, int a); | 135 void OnColorPicked(int r, int g, int b, int a); |
| 121 | 136 |
| 122 // NotificationObserver overrides. | 137 // NotificationObserver overrides. |
| 123 void Observe(int type, | 138 void Observe(int type, |
| 124 const NotificationSource& source, | 139 const NotificationSource& source, |
| 125 const NotificationDetails& details) override; | 140 const NotificationDetails& details) override; |
| 126 | 141 |
| 127 bool enabled_; | 142 bool enabled_; |
| 128 | 143 |
| 129 bool screencast_enabled_; | 144 bool screencast_enabled_; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 151 NotificationRegistrar registrar_; | 166 NotificationRegistrar registrar_; |
| 152 base::WeakPtrFactory<PageHandler> weak_factory_; | 167 base::WeakPtrFactory<PageHandler> weak_factory_; |
| 153 | 168 |
| 154 DISALLOW_COPY_AND_ASSIGN(PageHandler); | 169 DISALLOW_COPY_AND_ASSIGN(PageHandler); |
| 155 }; | 170 }; |
| 156 | 171 |
| 157 } // namespace protocol | 172 } // namespace protocol |
| 158 } // namespace content | 173 } // namespace content |
| 159 | 174 |
| 160 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ | 175 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ |
| OLD | NEW |