| 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 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "chrome/browser/devtools/devtools_contents_resizing_strategy.h" |
| 12 | 13 |
| 13 namespace base { | 14 namespace base { |
| 14 class ListValue; | 15 class ListValue; |
| 15 } | 16 } |
| 16 | 17 |
| 17 /** | 18 /** |
| 18 * Dispatcher for messages sent from the DevTools frontend running in an | 19 * Dispatcher for messages sent from the DevTools frontend running in an |
| 19 * isolated renderer (on chrome-devtools://) to the embedder in the browser. | 20 * isolated renderer (on chrome-devtools://) to the embedder in the browser. |
| 20 * | 21 * |
| 21 * The messages are sent via InspectorFrontendHost.sendMessageToEmbedder method. | 22 * The messages are sent via InspectorFrontendHost.sendMessageToEmbedder method. |
| 22 */ | 23 */ |
| 23 class DevToolsEmbedderMessageDispatcher { | 24 class DevToolsEmbedderMessageDispatcher { |
| 24 public: | 25 public: |
| 25 class Delegate { | 26 class Delegate { |
| 26 public: | 27 public: |
| 27 virtual ~Delegate() {} | 28 virtual ~Delegate() {} |
| 28 | 29 |
| 29 virtual void ActivateWindow() = 0; | 30 virtual void ActivateWindow() = 0; |
| 30 virtual void CloseWindow() = 0; | 31 virtual void CloseWindow() = 0; |
| 31 virtual void SetContentsInsets( | 32 virtual void SetContentsInsets( |
| 32 int top, int left, int bottom, int right) = 0; | 33 int top, int left, int bottom, int right) = 0; |
| 34 virtual void SetContentsResizingStrategy( |
| 35 const DevToolsContentsResizingStrategy& strategy) = 0; |
| 33 virtual void MoveWindow(int x, int y) = 0; | 36 virtual void MoveWindow(int x, int y) = 0; |
| 34 virtual void SetIsDocked(bool is_docked) = 0; | 37 virtual void SetIsDocked(bool is_docked) = 0; |
| 35 virtual void OpenInNewTab(const std::string& url) = 0; | 38 virtual void OpenInNewTab(const std::string& url) = 0; |
| 36 virtual void SaveToFile(const std::string& url, | 39 virtual void SaveToFile(const std::string& url, |
| 37 const std::string& content, | 40 const std::string& content, |
| 38 bool save_as) = 0; | 41 bool save_as) = 0; |
| 39 virtual void AppendToFile(const std::string& url, | 42 virtual void AppendToFile(const std::string& url, |
| 40 const std::string& content) = 0; | 43 const std::string& content) = 0; |
| 41 virtual void RequestFileSystems() = 0; | 44 virtual void RequestFileSystems() = 0; |
| 42 virtual void AddFileSystem() = 0; | 45 virtual void AddFileSystem() = 0; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 59 | 62 |
| 60 private: | 63 private: |
| 61 typedef base::Callback<bool(const base::ListValue&)> Handler; | 64 typedef base::Callback<bool(const base::ListValue&)> Handler; |
| 62 void RegisterHandler(const std::string& method, const Handler& handler); | 65 void RegisterHandler(const std::string& method, const Handler& handler); |
| 63 | 66 |
| 64 typedef std::map<std::string, Handler> HandlerMap; | 67 typedef std::map<std::string, Handler> HandlerMap; |
| 65 HandlerMap handlers_; | 68 HandlerMap handlers_; |
| 66 }; | 69 }; |
| 67 | 70 |
| 68 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EMBEDDER_MESSAGE_DISPATCHER_H_ | 71 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EMBEDDER_MESSAGE_DISPATCHER_H_ |
| OLD | NEW |