Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(30)

Side by Side Diff: chrome/browser/devtools/devtools_embedder_message_dispatcher.h

Issue 22972007: Migrate DevToolsWindow from specific to opaque frontend host messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EMBEDDER_MESSAGE_DISPATCHER_H_
6 #define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EMBEDDER_MESSAGE_DISPATCHER_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/callback.h"
12
13 namespace base {
14 class ListValue;
15 }
16
17 /**
18 * Dispatcher for messages sent from the DevTools frontend running in an
19 * isolated renderer (on chrome-devtools://) to the embedder in the browser.
20 *
21 * The messages are sent via InspectorFrontendHost.sendMessageToEmbedder method.
22 */
23 class DevToolsEmbedderMessageDispatcher {
24 public:
25 class Delegate {
26 public:
27 virtual ~Delegate() {}
28
29 virtual void ActivateWindow() = 0;
30 virtual void CloseWindow() = 0;
31 virtual void MoveWindow(int x, int y) = 0;
32 virtual void SetDockSide(const std::string& side) = 0;
33 virtual void OpenInNewTab(const std::string& url) = 0;
34 virtual void SaveToFile(const std::string& url,
35 const std::string& content,
36 bool save_as) = 0;
37 virtual void AppendToFile(const std::string& url,
38 const std::string& content) = 0;
39 virtual void RequestFileSystems() = 0;
40 virtual void AddFileSystem() = 0;
41 virtual void RemoveFileSystem(const std::string& file_system_path) = 0;
42 virtual void IndexPath(int request_id,
43 const std::string& file_system_path) = 0;
44 virtual void StopIndexing(int request_id) = 0;
45 virtual void SearchInPath(int request_id,
46 const std::string& file_system_path,
47 const std::string& query) = 0;
48 };
49
50 explicit DevToolsEmbedderMessageDispatcher(Delegate* delegate);
51
52 ~DevToolsEmbedderMessageDispatcher();
53
54 void Dispatch(const std::string& message);
55
56 private:
57 typedef base::Callback<bool(const base::ListValue&)> Handler;
58 void RegisterHandler(const std::string& method, const Handler& handler);
59
60 typedef std::map<std::string, Handler> HandlerMap;
61 HandlerMap handlers_;
62 };
63
64 #endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_EMBEDDER_MESSAGE_DISPATCHER_H_
OLDNEW
« no previous file with comments | « chrome/browser/devtools/OWNERS ('k') | chrome/browser/devtools/devtools_embedder_message_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698