OLD | NEW |
(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 |
OLD | NEW |