summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_function_dispatcher.h
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-01 08:46:25 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-01 08:46:25 +0000
commit811bfe371c3518e58664fb5191a6962314f8f05f (patch)
tree6dc3cb4264f9d87c93a2313fa856c1ea7e6e23e8 /chrome/browser/extensions/extension_function_dispatcher.h
parent20fdbc31d0e998ba81d8337259b43e57e2ff02b7 (diff)
downloadchromium_src-811bfe371c3518e58664fb5191a6962314f8f05f.zip
chromium_src-811bfe371c3518e58664fb5191a6962314f8f05f.tar.gz
chromium_src-811bfe371c3518e58664fb5191a6962314f8f05f.tar.bz2
In this episode, we implement the DOMUI interface for extension views that are rendered in the main tab contents area. This gets us loaded and unloaded at the right place and removes many special cases for extensions from the RenderViewHost and RenderViewHostDelegate hierarchy.
BUG=13936 Review URL: http://codereview.chromium.org/126137 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19717 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_function_dispatcher.h')
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extension_function_dispatcher.h b/chrome/browser/extensions/extension_function_dispatcher.h
index b59e256..0e79882 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_;