summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r--chrome/browser/dom_ui/dom_ui.cc6
-rw-r--r--chrome/browser/dom_ui/dom_ui.h12
-rw-r--r--chrome/browser/dom_ui/dom_ui_factory.cc10
3 files changed, 24 insertions, 4 deletions
diff --git a/chrome/browser/dom_ui/dom_ui.cc b/chrome/browser/dom_ui/dom_ui.cc
index 3a7b221..3b0472b 100644
--- a/chrome/browser/dom_ui/dom_ui.cc
+++ b/chrome/browser/dom_ui/dom_ui.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tab_contents/tab_contents_view.h"
+#include "chrome/common/bindings_policy.h"
DOMUI::DOMUI(TabContents* contents)
: hide_favicon_(false),
@@ -20,6 +21,7 @@ DOMUI::DOMUI(TabContents* contents)
focus_location_bar_by_default_(false),
should_hide_url_(false),
link_transition_type_(PageTransition::LINK),
+ bindings_(BindingsPolicy::DOM_UI),
tab_contents_(contents) {
}
@@ -32,7 +34,9 @@ DOMUI::~DOMUI() {
// DOMUI, public: -------------------------------------------------------------
void DOMUI::ProcessDOMUIMessage(const std::string& message,
- const std::string& content) {
+ const std::string& content,
+ int request_id,
+ bool has_callback) {
// Look up the callback for this message.
MessageCallbackMap::const_iterator callback =
message_callbacks_.find(message);
diff --git a/chrome/browser/dom_ui/dom_ui.h b/chrome/browser/dom_ui/dom_ui.h
index f7bb0e7..fad04e5 100644
--- a/chrome/browser/dom_ui/dom_ui.h
+++ b/chrome/browser/dom_ui/dom_ui.h
@@ -32,8 +32,10 @@ class DOMUI {
virtual void RenderViewCreated(RenderViewHost* render_view_host) {}
// Called from DOMUIContents.
- void ProcessDOMUIMessage(const std::string& message,
- const std::string& content);
+ virtual void ProcessDOMUIMessage(const std::string& message,
+ const std::string& content,
+ int request_id,
+ bool has_callback);
// Used by DOMMessageHandlers.
typedef Callback1<const Value*>::Type MessageCallback;
@@ -77,6 +79,10 @@ class DOMUI {
return link_transition_type_;
}
+ const int bindings() const {
+ return bindings_;
+ }
+
// Call a Javascript function by sending its name and arguments down to
// the renderer. This is asynchronous; there's no way to get the result
// of the call, and should be thought of more like sending a message to
@@ -106,6 +112,8 @@ class DOMUI {
bool should_hide_url_;
string16 overridden_title_; // Defaults to empty string.
PageTransition::Type link_transition_type_; // Defaults to LINK.
+ int bindings_; // The bindings from BindingsPolicy that should be enabled for
+ // this page.
private:
// Execute a string of raw Javascript on the page.
diff --git a/chrome/browser/dom_ui/dom_ui_factory.cc b/chrome/browser/dom_ui/dom_ui_factory.cc
index c5576cf..8827c02 100644
--- a/chrome/browser/dom_ui/dom_ui_factory.cc
+++ b/chrome/browser/dom_ui/dom_ui_factory.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/dom_ui/html_dialog_ui.h"
#include "chrome/browser/dom_ui/new_tab_ui.h"
#include "chrome/browser/extensions/extensions_ui.h"
+#include "chrome/browser/extensions/extension_dom_ui.h"
#include "chrome/common/url_constants.h"
#ifdef CHROME_PERSONALIZATION
#include "chrome/personalization/personalization.h"
@@ -34,6 +35,12 @@ static bool CreateDOMUI(const GURL& url, TabContents* tab_contents,
return true;
}
+ if (url.SchemeIs(chrome::kExtensionScheme)) {
+ if (new_ui)
+ *new_ui = new ExtensionDOMUI(tab_contents);
+ return true;
+ }
+
#ifdef CHROME_PERSONALIZATION
if (Personalization::NeedsDOMUI(url)) {
if (new_ui)
@@ -91,7 +98,8 @@ static bool CreateDOMUI(const GURL& url, TabContents* tab_contents,
// static
bool DOMUIFactory::HasDOMUIScheme(const GURL& url) {
return url.SchemeIs(chrome::kChromeInternalScheme) ||
- url.SchemeIs(chrome::kChromeUIScheme);
+ url.SchemeIs(chrome::kChromeUIScheme) ||
+ url.SchemeIs(chrome::kExtensionScheme);
}
// static