summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_devtools_events.h
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-24 22:11:07 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-24 22:11:07 +0000
commit89ebc7edb982ebf5f8b185aa6e3aae6904eed965 (patch)
treeba32c69980b01c7c7d8d3f9d3cabebcb9ed88711 /chrome/browser/extensions/extension_devtools_events.h
parent5101c0073bf723b6e6bc81273264eaf7ac124937 (diff)
downloadchromium_src-89ebc7edb982ebf5f8b185aa6e3aae6904eed965.zip
chromium_src-89ebc7edb982ebf5f8b185aa6e3aae6904eed965.tar.gz
chromium_src-89ebc7edb982ebf5f8b185aa6e3aae6904eed965.tar.bz2
Exposes a chrome.devtools object to extensions. This allows extensions to call chrome.devtools.connect() to open up a Port by which it can receive devtools messages to implement the proposed perf trace extensions API documented here:
http://code.google.com/p/chromium/wiki/ExtensionsPerfTraceAPI Review URL: http://codereview.chromium.org/159882 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24158 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_devtools_events.h')
-rw-r--r--chrome/browser/extensions/extension_devtools_events.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_devtools_events.h b/chrome/browser/extensions/extension_devtools_events.h
new file mode 100644
index 0000000..ff985b2
--- /dev/null
+++ b/chrome/browser/extensions/extension_devtools_events.h
@@ -0,0 +1,37 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_DEVTOOLS_EVENTS_H_
+#define CHROME_BROWSER_EXTENSIONS_EXTENSION_DEVTOOLS_EVENTS_H_
+
+#include <string>
+
+#include "base/basictypes.h"
+
+// Static utility functions for dealing with extension devtools event names.
+// The format of the event names is <prefix>.<tab id>.<event name>
+// Equivalent name munging is done in the extension process in JavaScript
+// by chrome/renderer/resources/extension_process_bindings.js
+class ExtensionDevToolsEvents {
+ public:
+ // Checks if an event name is a magic devtools event name. If so,
+ // the tab id of the event is put in *tab_id.
+ static bool IsDevToolsEventName(const std::string& event_name, int* tab_id);
+
+ // Generates the event string for an onPageEvent for a given tab.
+ static std::string OnPageEventNameForTab(int tab_id);
+
+ // Generates the event string for an onPageEvent for a given tab.
+ static std::string OnTabUrlChangeEventNameForTab(int tab_id);
+
+ // Generates the event string for an onTabCloseEvent for a given tab.
+ static std::string OnTabCloseEventNameForTab(int tab_id);
+
+ private:
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ExtensionDevToolsEvents);
+};
+
+#endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_DEVTOOLS_EVENTS_H_
+