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

Side by Side Diff: chrome/browser/extensions/extension_devtools_events.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, 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
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_EVENTS_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_DEVTOOLS_EVENTS_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11
12 // Static utility functions for dealing with extension devtools event names.
13 // The format of the event names is <prefix>.<tab id>.<event name>
14 // Equivalent name munging is done in the extension process in JavaScript
15 // by chrome/renderer/resources/extension_process_bindings.js
16 class ExtensionDevToolsEvents {
17 public:
18 // Checks if an event name is a magic devtools event name. If so,
19 // the tab id of the event is put in *tab_id.
20 static bool IsDevToolsEventName(const std::string& event_name, int* tab_id);
21
22 // Generates the event string for an onPageEvent for a given tab.
23 static std::string OnPageEventNameForTab(int tab_id);
24
25 // Generates the event string for an onPageEvent for a given tab.
26 static std::string OnTabUrlChangeEventNameForTab(int tab_id);
27
28 // Generates the event string for an onTabCloseEvent for a given tab.
29 static std::string OnTabCloseEventNameForTab(int tab_id);
30
31 private:
32
33 DISALLOW_IMPLICIT_CONSTRUCTORS(ExtensionDevToolsEvents);
34 };
35
36 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DEVTOOLS_EVENTS_H_
37
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_devtools_browsertests.cc ('k') | chrome/browser/extensions/extension_devtools_events.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698