OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EMBEDDER_MESSAGE_DISPATCHER_H_ | 5 #ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EMBEDDER_MESSAGE_DISPATCHER_H_ |
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EMBEDDER_MESSAGE_DISPATCHER_H_ | 6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EMBEDDER_MESSAGE_DISPATCHER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 * isolated renderer (on chrome-devtools://) to the embedder in the browser. | 22 * isolated renderer (on chrome-devtools://) to the embedder in the browser. |
23 * | 23 * |
24 * The messages are sent via InspectorFrontendHost.sendMessageToEmbedder method. | 24 * The messages are sent via InspectorFrontendHost.sendMessageToEmbedder method. |
25 */ | 25 */ |
26 class DevToolsEmbedderMessageDispatcher { | 26 class DevToolsEmbedderMessageDispatcher { |
27 public: | 27 public: |
28 class Delegate { | 28 class Delegate { |
29 public: | 29 public: |
30 virtual ~Delegate() {} | 30 virtual ~Delegate() {} |
31 | 31 |
32 virtual void ActivateWindow() = 0; | 32 virtual void ActivateWindow(int request_id) = 0; |
33 virtual void CloseWindow() = 0; | 33 virtual void CloseWindow(int request_id) = 0; |
34 virtual void LoadCompleted() = 0; | 34 virtual void LoadCompleted(int request_id) = 0; |
35 virtual void SetInspectedPageBounds(const gfx::Rect& rect) = 0; | 35 virtual void SetInspectedPageBounds(int request_id, |
36 virtual void InspectElementCompleted() = 0; | 36 const gfx::Rect& rect) = 0; |
37 virtual void InspectedURLChanged(const std::string& url) = 0; | 37 virtual void InspectElementCompleted(int request_id) = 0; |
38 virtual void SetIsDocked(bool is_docked) = 0; | 38 virtual void InspectedURLChanged(int request_id, |
39 virtual void OpenInNewTab(const std::string& url) = 0; | 39 const std::string& url) = 0; |
40 virtual void SaveToFile(const std::string& url, | 40 virtual void SetIsDocked(int request_id, bool is_docked) = 0; |
| 41 virtual void OpenInNewTab(int request_id, const std::string& url) = 0; |
| 42 virtual void SaveToFile(int request_id, |
| 43 const std::string& url, |
41 const std::string& content, | 44 const std::string& content, |
42 bool save_as) = 0; | 45 bool save_as) = 0; |
43 virtual void AppendToFile(const std::string& url, | 46 virtual void AppendToFile(int request_id, |
| 47 const std::string& url, |
44 const std::string& content) = 0; | 48 const std::string& content) = 0; |
45 virtual void RequestFileSystems() = 0; | 49 virtual void RequestFileSystems(int request_id) = 0; |
46 virtual void AddFileSystem() = 0; | 50 virtual void AddFileSystem(int request_id) = 0; |
47 virtual void RemoveFileSystem(const std::string& file_system_path) = 0; | 51 virtual void RemoveFileSystem(int request_id, |
| 52 const std::string& file_system_path) = 0; |
48 virtual void UpgradeDraggedFileSystemPermissions( | 53 virtual void UpgradeDraggedFileSystemPermissions( |
| 54 int request_id, |
49 const std::string& file_system_url) = 0; | 55 const std::string& file_system_url) = 0; |
50 virtual void IndexPath(int request_id, | 56 virtual void IndexPath(int request_id, |
| 57 int index_request_id, |
51 const std::string& file_system_path) = 0; | 58 const std::string& file_system_path) = 0; |
52 virtual void StopIndexing(int request_id) = 0; | 59 virtual void StopIndexing(int request_id, int index_request_id) = 0; |
53 virtual void SearchInPath(int request_id, | 60 virtual void SearchInPath(int request_id, |
| 61 int search_request_id, |
54 const std::string& file_system_path, | 62 const std::string& file_system_path, |
55 const std::string& query) = 0; | 63 const std::string& query) = 0; |
56 virtual void SetWhitelistedShortcuts(const std::string& message) = 0; | 64 virtual void SetWhitelistedShortcuts(int request_id, |
57 virtual void ZoomIn() = 0; | 65 const std::string& message) = 0; |
58 virtual void ZoomOut() = 0; | 66 virtual void ZoomIn(int request_id) = 0; |
59 virtual void ResetZoom() = 0; | 67 virtual void ZoomOut(int request_id) = 0; |
60 virtual void OpenUrlOnRemoteDeviceAndInspect(const std::string& browser_id, | 68 virtual void ResetZoom(int request_id) = 0; |
| 69 virtual void OpenUrlOnRemoteDeviceAndInspect(int request_id, |
| 70 const std::string& browser_id, |
61 const std::string& url) = 0; | 71 const std::string& url) = 0; |
62 | 72 virtual void SetDeviceCountUpdatesEnabled(int request_id, bool enabled) = 0; |
63 virtual void SetDeviceCountUpdatesEnabled(bool enabled) = 0; | 73 virtual void SetDevicesUpdatesEnabled(int request_id, bool enabled) = 0; |
64 virtual void SetDevicesUpdatesEnabled(bool enabled) = 0; | 74 virtual void SendMessageToBrowser(int request_id, |
65 virtual void SendMessageToBrowser(const std::string& message) = 0; | 75 const std::string& message) = 0; |
66 virtual void RecordActionUMA(const std::string& name, int action) = 0; | 76 virtual void RecordActionUMA(int request_id, |
| 77 const std::string& name, |
| 78 int action) = 0; |
| 79 virtual void SendJsonRequest(int request_id, |
| 80 const std::string& browser_id, |
| 81 const std::string& url) = 0; |
67 }; | 82 }; |
68 | 83 |
69 virtual ~DevToolsEmbedderMessageDispatcher() {} | 84 virtual ~DevToolsEmbedderMessageDispatcher() {} |
70 virtual bool Dispatch(const std::string& method, | 85 virtual void Dispatch(int request_id, |
71 const base::ListValue* params, | 86 const std::string& method, |
72 std::string* error) = 0; | 87 const base::ListValue* params); |
73 | 88 |
74 static DevToolsEmbedderMessageDispatcher* createForDevToolsFrontend( | 89 static DevToolsEmbedderMessageDispatcher* CreateForDevToolsFrontend( |
75 Delegate* delegate); | 90 Delegate* delegate); |
76 }; | 91 }; |
77 | 92 |
78 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EMBEDDER_MESSAGE_DISPATCHER_H_ | 93 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EMBEDDER_MESSAGE_DISPATCHER_H_ |
OLD | NEW |