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

Unified Diff: chrome/browser/tab_contents/tab_contents.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
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/views/tabs/dragged_tab_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 5b89157f6fdd9cdfd1f5e2ee87096c1bc27d4f16..e0e6fe5c1a5b4e559e4bd872dd95722b6d7d40d7 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -497,10 +497,6 @@ bool TabContents::ShouldDisplayURL() {
if (entry && entry->IsViewSourceMode())
return true;
- // Hide the URL in chrome-extension://.
- if (GetURL().SchemeIs(chrome::kExtensionScheme))
- return false;
-
DOMUI* dom_ui = GetDOMUIForCurrentState();
if (dom_ui)
return !dom_ui->should_hide_url();
@@ -1503,13 +1499,6 @@ RendererPreferences TabContents::GetRendererPrefs() const {
return RendererPreferences();
}
-ExtensionFunctionDispatcher* TabContents::CreateExtensionFunctionDispatcher(
- RenderViewHost* render_view_host,
- const std::string& extension_id) {
- return delegate()->CreateExtensionFunctionDispatcher(render_view_host,
- extension_id);
-}
-
TabContents* TabContents::GetAsTabContents() {
return this;
}
@@ -1864,7 +1853,9 @@ void TabContents::DomOperationResponse(const std::string& json_string,
}
void TabContents::ProcessDOMUIMessage(const std::string& message,
- const std::string& content) {
+ const std::string& content,
+ int request_id,
+ bool has_callback) {
if (!render_manager_.dom_ui()) {
// We shouldn't get a DOM UI message when we haven't enabled the DOM UI.
// Because the renderer might be owned and sending random messages, we need
@@ -1872,7 +1863,8 @@ void TabContents::ProcessDOMUIMessage(const std::string& message,
NOTREACHED();
return;
}
- render_manager_.dom_ui()->ProcessDOMUIMessage(message, content);
+ render_manager_.dom_ui()->ProcessDOMUIMessage(message, content, request_id,
+ has_callback);
}
void TabContents::DocumentLoadedInFrame() {
@@ -2280,16 +2272,11 @@ TabContents::GetLastCommittedNavigationEntryForRenderManager() {
bool TabContents::CreateRenderViewForRenderManager(
RenderViewHost* render_view_host) {
- // When we're running a DOM UI, the RenderViewHost needs to be put in DOM UI
- // mode before CreateRenderView is called. When we're asked to create a
- // RenderView, that means it's for the pending entry, so we have to use the
- // pending DOM UI.
+ // If the pending navigation is to a DOMUI, tell the RenderView about any
+ // bindings it will need enabled.
if (render_manager_.pending_dom_ui())
- render_view_host->AllowDOMUIBindings();
-
- // Ditto for extension bindings.
- if (controller().pending_entry()->url().SchemeIs(chrome::kExtensionScheme))
- render_view_host->AllowExtensionBindings();
+ render_view_host->AllowBindings(
+ render_manager_.pending_dom_ui()->bindings());
RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host);
if (!render_view_host->CreateRenderView())
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/views/tabs/dragged_tab_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698