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

Unified Diff: chrome/browser/extensions/extension_function_dispatcher.h

Issue 126137: Part 1 of merging Extensions and DOMUI (Closed)
Patch Set: add test and rebase Created 11 years, 6 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_function_dispatcher.h
diff --git a/chrome/browser/extensions/extension_function_dispatcher.h b/chrome/browser/extensions/extension_function_dispatcher.h
index b59e25639be15cea89bd46b88d7b88a5cb404f81..0e7988250c394363951bbc69a911b800ed0640f2 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.h
+++ b/chrome/browser/extensions/extension_function_dispatcher.h
@@ -6,9 +6,11 @@
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_FUNCTION_DISPATCHER_H_
#include <string>
+#include <set>
#include <vector>
#include "base/ref_counted.h"
+#include "googleurl/src/gurl.h"
class Browser;
class ExtensionFunction;
@@ -47,9 +49,12 @@ class ExtensionFunctionDispatcher {
// Resets all functions to their initial implementation.
static void ResetFunctions();
+ // Retrieves a vector of all EFD instances.
+ static std::set<ExtensionFunctionDispatcher*>* all_instances();
+
ExtensionFunctionDispatcher(RenderViewHost* render_view_host,
Delegate* delegate,
- const std::string& extension_id);
+ const GURL& url);
~ExtensionFunctionDispatcher();
// Handle a request to execute an extension function.
@@ -67,18 +72,24 @@ class ExtensionFunctionDispatcher {
// the renderer.
void HandleBadMessage(ExtensionFunction* api);
+ // Gets the URL for the view we're displaying.
+ const GURL& url() { return url_; }
+
// Gets the ID for this extension.
- std::string extension_id() { return extension_id_; }
+ const std::string extension_id() { return url_.host(); }
// The profile that this dispatcher is associated with.
Profile* profile();
+ // The RenderViewHost this dispatcher is associated with.
+ RenderViewHost* render_view_host() { return render_view_host_; }
+
private:
RenderViewHost* render_view_host_;
Delegate* delegate_;
- std::string extension_id_;
+ GURL url_;
scoped_refptr<Peer> peer_;
« no previous file with comments | « chrome/browser/extensions/extension_dom_ui.cc ('k') | chrome/browser/extensions/extension_function_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698