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

Side by Side Diff: chrome/browser/extensions/extension_devtools_bridge.h

Issue 159882: Implements extensions devtools API (Closed)
Patch Set: Fixes flakiness in tests by grabbing tab ID in C++ land and passing it down Created 11 years, 4 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
OLDNEW
(Empty)
1 // Copyright (c) 2009 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_EXTENSIONS_EXTENSION_DEVTOOLS_BRIDGE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_DEVTOOLS_BRIDGE_H_
7
8 #include <string>
9
10 #include "base/ref_counted.h"
11 #include "chrome/browser/debugger/devtools_client_host.h"
12 #include "chrome/browser/extensions/extension_devtools_manager.h"
13 #include "chrome/browser/extensions/extension_message_service.h"
14
15 class Profile;
16 class RenderViewHost;
17
18 // This class is a DevToolsClientHost that fires extension events.
19 class ExtensionDevToolsBridge : public DevToolsClientHost {
20 public:
21 ExtensionDevToolsBridge(int tab_id, Profile* profile);
22 virtual ~ExtensionDevToolsBridge();
23
24 bool RegisterAsDevToolsClientHost();
25 void UnregisterAsDevToolsClientHost();
26
27 // DevToolsClientHost, called when the tab inspected by this client is
28 // closing.
29 virtual void InspectedTabClosing();
30
31 // DevToolsClientHost, called to send a message to this host.
32 virtual void SendMessageToClient(const IPC::Message& msg);
33
34 private:
35 void OnRpcMessage(const std::string& class_name,
36 const std::string& message_name,
37 const std::string& msg);
38
39 // ID of the tab we are monitoring.
40 int tab_id_;
41 // Host of the tab we are monitoring, NULL if not monitoring anything.
42 RenderViewHost* inspected_rvh_;
43
44 scoped_refptr<ExtensionDevToolsManager> extension_devtools_manager_;
45 scoped_refptr<ExtensionMessageService> extension_message_service_;
46
47 // Profile that owns our tab
48 Profile* profile_;
49
50 // The names of the events fired at extensions depend on the tab id,
51 // so we store the various event names in each bridge.
52 const std::string on_page_event_name_;
53 const std::string on_tab_url_change_event_name_;
54 const std::string on_tab_close_event_name_;
55
56 DISALLOW_COPY_AND_ASSIGN(ExtensionDevToolsBridge);
57 };
58
59 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DEVTOOLS_BRIDGE_H_
60
OLDNEW
« no previous file with comments | « chrome/browser/automation/automation_profile_impl.h ('k') | chrome/browser/extensions/extension_devtools_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698