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

Side by Side Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 3263007: Reland r57788 - Expose Extension Bindings to Component Applications (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: don't hide gallery url in omnibar Created 10 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/tab_contents/tab_contents.h" 5 #include "chrome/browser/tab_contents/tab_contents.h"
6 6
7 #if defined(OS_CHROMEOS) 7 #if defined(OS_CHROMEOS)
8 // For GdkScreen 8 // For GdkScreen
9 #include <gdk/gdk.h> 9 #include <gdk/gdk.h>
10 #endif // defined(OS_CHROMEOS) 10 #endif // defined(OS_CHROMEOS)
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 851
852 if (delegate_ && delegate_->ShouldEnablePreferredSizeNotifications()) { 852 if (delegate_ && delegate_->ShouldEnablePreferredSizeNotifications()) {
853 dest_render_view_host->EnablePreferredSizeChangedMode( 853 dest_render_view_host->EnablePreferredSizeChangedMode(
854 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow); 854 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow);
855 } 855 }
856 856
857 // For security, we should never send non-DOM-UI URLs (other than about:blank) 857 // For security, we should never send non-DOM-UI URLs (other than about:blank)
858 // to a DOM UI renderer. Double check that here. 858 // to a DOM UI renderer. Double check that here.
859 int enabled_bindings = dest_render_view_host->enabled_bindings(); 859 int enabled_bindings = dest_render_view_host->enabled_bindings();
860 bool is_allowed_in_dom_ui_renderer = 860 bool is_allowed_in_dom_ui_renderer =
861 DOMUIFactory::UseDOMUIForURL(entry.url()) || 861 DOMUIFactory::UseDOMUIForURL(profile(), entry.url()) ||
862 entry.url() == GURL(chrome::kAboutBlankURL); 862 entry.url() == GURL(chrome::kAboutBlankURL);
863 CHECK(!BindingsPolicy::is_dom_ui_enabled(enabled_bindings) || 863 CHECK(!BindingsPolicy::is_dom_ui_enabled(enabled_bindings) ||
864 is_allowed_in_dom_ui_renderer); 864 is_allowed_in_dom_ui_renderer);
865 865
866 // Tell DevTools agent that it is attached prior to the navigation. 866 // Tell DevTools agent that it is attached prior to the navigation.
867 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); 867 DevToolsManager* devtools_manager = DevToolsManager::GetInstance();
868 if (devtools_manager) { // NULL in unit tests. 868 if (devtools_manager) { // NULL in unit tests.
869 devtools_manager->OnNavigatingToPendingEntry(render_view_host(), 869 devtools_manager->OnNavigatingToPendingEntry(render_view_host(),
870 dest_render_view_host, 870 dest_render_view_host,
871 entry.url()); 871 entry.url());
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1597 return render_manager_.dom_ui(); 1597 return render_manager_.dom_ui();
1598 } 1598 }
1599 1599
1600 void TabContents::DidNavigateMainFramePostCommit( 1600 void TabContents::DidNavigateMainFramePostCommit(
1601 const NavigationController::LoadCommittedDetails& details, 1601 const NavigationController::LoadCommittedDetails& details,
1602 const ViewHostMsg_FrameNavigate_Params& params) { 1602 const ViewHostMsg_FrameNavigate_Params& params) {
1603 if (opener_dom_ui_type_ != DOMUIFactory::kNoDOMUI) { 1603 if (opener_dom_ui_type_ != DOMUIFactory::kNoDOMUI) {
1604 // If this is a window.open navigation, use the same DOMUI as the renderer 1604 // If this is a window.open navigation, use the same DOMUI as the renderer
1605 // that opened the window, as long as both renderers have the same 1605 // that opened the window, as long as both renderers have the same
1606 // privileges. 1606 // privileges.
1607 if (opener_dom_ui_type_ == DOMUIFactory::GetDOMUIType(GetURL())) { 1607 if (opener_dom_ui_type_ ==
1608 DOMUIFactory::GetDOMUIType(profile(), GetURL())) {
1608 DOMUI* dom_ui = DOMUIFactory::CreateDOMUIForURL(this, GetURL()); 1609 DOMUI* dom_ui = DOMUIFactory::CreateDOMUIForURL(this, GetURL());
1609 // dom_ui might be NULL if the URL refers to a non-existent extension. 1610 // dom_ui might be NULL if the URL refers to a non-existent extension.
1610 if (dom_ui) { 1611 if (dom_ui) {
1611 render_manager_.SetDOMUIPostCommit(dom_ui); 1612 render_manager_.SetDOMUIPostCommit(dom_ui);
1612 dom_ui->RenderViewCreated(render_view_host()); 1613 dom_ui->RenderViewCreated(render_view_host());
1613 } 1614 }
1614 } 1615 }
1615 opener_dom_ui_type_ = DOMUIFactory::kNoDOMUI; 1616 opener_dom_ui_type_ = DOMUIFactory::kNoDOMUI;
1616 } 1617 }
1617 1618
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after
3241 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); 3242 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save));
3242 } 3243 }
3243 3244
3244 Profile* TabContents::GetProfileForPasswordManager() { 3245 Profile* TabContents::GetProfileForPasswordManager() {
3245 return profile(); 3246 return profile();
3246 } 3247 }
3247 3248
3248 bool TabContents::DidLastPageLoadEncounterSSLErrors() { 3249 bool TabContents::DidLastPageLoadEncounterSSLErrors() {
3249 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); 3250 return controller().ssl_manager()->ProcessedSSLErrorFromRequest();
3250 } 3251 }
OLDNEW
« no previous file with comments | « chrome/browser/tab_contents/render_view_host_manager.cc ('k') | chrome/browser/tab_contents/tab_contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698