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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_devtools_events.h
diff --git a/chrome/browser/extensions/extension_devtools_events.h b/chrome/browser/extensions/extension_devtools_events.h
new file mode 100644
index 0000000000000000000000000000000000000000..ff985b2b7df22d402ca1329fbc0a0f00256ccc95
--- /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_
+
« 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