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

Unified Diff: chrome/browser/extensions/extension_dom_ui.cc

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_dom_ui.cc
diff --git a/chrome/browser/extensions/extension_dom_ui.cc b/chrome/browser/extensions/extension_dom_ui.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0d243455a0d226ac3ef391fe3602096b720db0a6
--- /dev/null
+++ b/chrome/browser/extensions/extension_dom_ui.cc
@@ -0,0 +1,31 @@
+#include "chrome/browser/extensions/extension_dom_ui.h"
+
+#include "chrome/browser/browser.h"
+#include "chrome/browser/tab_contents/tab_contents.h"
+#include "chrome/common/bindings_policy.h"
+
+ExtensionDOMUI::ExtensionDOMUI(TabContents* tab_contents)
+ : DOMUI(tab_contents) {
+ // TODO(aa): It would be cool to show the extension's icon in here.
+ hide_favicon_ = true;
+ should_hide_url_ = true;
+ bindings_ = BindingsPolicy::EXTENSION;
+}
+
+void ExtensionDOMUI::RenderViewCreated(RenderViewHost* render_view_host) {
+ extension_function_dispatcher_.reset(
+ new ExtensionFunctionDispatcher(render_view_host, this,
+ tab_contents()->GetURL()));
+}
+
+void ExtensionDOMUI::ProcessDOMUIMessage(const std::string& message,
+ const std::string& content,
+ int request_id,
+ bool has_callback) {
+ extension_function_dispatcher_->HandleRequest(message, content, request_id,
+ has_callback);
+}
+
+Browser* ExtensionDOMUI::GetBrowser() {
+ return static_cast<Browser*>(tab_contents()->delegate());
+}
« no previous file with comments | « chrome/browser/extensions/extension_dom_ui.h ('k') | chrome/browser/extensions/extension_function_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698