OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ | |
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ | |
7 | |
8 #include "base/memory/weak_ptr.h" | |
9 #include "content/browser/devtools/protocol/devtools_protocol_handler_impl.h" | |
10 | |
11 namespace content { | |
12 | |
13 class RenderViewHostImpl; | |
14 | |
15 namespace devtools { | |
16 namespace page { | |
17 | |
18 class PageHandler { | |
19 public: | |
20 typedef DevToolsProtocolClient::Response Response; | |
21 | |
22 PageHandler(); | |
23 virtual ~PageHandler(); | |
24 | |
25 void SetRenderViewHost(RenderViewHostImpl* host); | |
26 void SetClient(scoped_ptr<Client> client); | |
27 | |
28 Response Enable(); | |
29 Response Disable(); | |
30 | |
31 Response Reload(const bool* ignoreCache, | |
32 const std::string* script_to_evaluate_on_load, | |
33 const std::string* script_preprocessor); | |
34 | |
35 Response Navigate(const std::string& url, FrameId* frame_id); | |
36 | |
37 Response GetNavigationHistory(int* current_index, | |
38 std::vector<NavigationEntry>* entries); | |
39 | |
40 Response NavigateToHistoryEntry(int entry_id); | |
41 Response SetTouchEmulationEnabled(bool enabled); | |
42 | |
43 scoped_refptr<DevToolsProtocol::Response> CaptureScreenshot( | |
44 scoped_refptr<DevToolsProtocol::Command> command); | |
45 | |
46 Response CanScreencast(bool* result); | |
47 Response CanEmulate(bool* result); | |
48 | |
49 Response StartScreencast(const std::string* format, | |
50 const int* quality, | |
51 const int* max_width, | |
52 const int* max_height); | |
53 | |
54 Response StopScreencast(); | |
55 Response HandleJavaScriptDialog(bool accept, const std::string* prompt_text); | |
56 | |
57 scoped_refptr<DevToolsProtocol::Response> QueryUsageAndQuota( | |
58 const std::string& security_origin, | |
59 scoped_refptr<DevToolsProtocol::Command> command); | |
60 | |
61 Response SetColorPickerEnabled(bool enabled); | |
62 | |
63 private: | |
64 RenderViewHostImpl* host_; | |
65 scoped_ptr<Client> client_; | |
66 base::WeakPtrFactory<PageHandler> weak_factory_; | |
67 | |
68 void ScreenshotCaptured( | |
69 scoped_refptr<DevToolsProtocol::Command> command, | |
70 const unsigned char* png_data, | |
71 size_t png_size); | |
72 | |
73 DISALLOW_COPY_AND_ASSIGN(PageHandler); | |
74 }; | |
75 | |
76 } // namespace page | |
77 } // namespace devtools | |
78 } // namespace content | |
79 | |
80 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_PAGE_HANDLER_H_ | |
OLD | NEW |