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

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

Issue 3163044: Expose Extension Bindings to Component Applications (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: review chanecs 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 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 850
851 if (delegate_ && delegate_->ShouldEnablePreferredSizeNotifications()) { 851 if (delegate_ && delegate_->ShouldEnablePreferredSizeNotifications()) {
852 dest_render_view_host->EnablePreferredSizeChangedMode( 852 dest_render_view_host->EnablePreferredSizeChangedMode(
853 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow); 853 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow);
854 } 854 }
855 855
856 // For security, we should never send non-DOM-UI URLs (other than about:blank) 856 // For security, we should never send non-DOM-UI URLs (other than about:blank)
857 // to a DOM UI renderer. Double check that here. 857 // to a DOM UI renderer. Double check that here.
858 int enabled_bindings = dest_render_view_host->enabled_bindings(); 858 int enabled_bindings = dest_render_view_host->enabled_bindings();
859 bool is_allowed_in_dom_ui_renderer = 859 bool is_allowed_in_dom_ui_renderer =
860 DOMUIFactory::UseDOMUIForURL(entry.url()) || 860 DOMUIFactory::UseDOMUIForURL(profile(), entry.url()) ||
861 entry.url() == GURL(chrome::kAboutBlankURL); 861 entry.url() == GURL(chrome::kAboutBlankURL);
862 CHECK(!BindingsPolicy::is_dom_ui_enabled(enabled_bindings) || 862 CHECK(!BindingsPolicy::is_dom_ui_enabled(enabled_bindings) ||
863 is_allowed_in_dom_ui_renderer); 863 is_allowed_in_dom_ui_renderer);
864 864
865 // Tell DevTools agent that it is attached prior to the navigation. 865 // Tell DevTools agent that it is attached prior to the navigation.
866 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); 866 DevToolsManager* devtools_manager = DevToolsManager::GetInstance();
867 if (devtools_manager) { // NULL in unit tests. 867 if (devtools_manager) { // NULL in unit tests.
868 devtools_manager->OnNavigatingToPendingEntry(render_view_host(), 868 devtools_manager->OnNavigatingToPendingEntry(render_view_host(),
869 dest_render_view_host, 869 dest_render_view_host,
870 entry.url()); 870 entry.url());
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 return render_manager_.dom_ui(); 1596 return render_manager_.dom_ui();
1597 } 1597 }
1598 1598
1599 void TabContents::DidNavigateMainFramePostCommit( 1599 void TabContents::DidNavigateMainFramePostCommit(
1600 const NavigationController::LoadCommittedDetails& details, 1600 const NavigationController::LoadCommittedDetails& details,
1601 const ViewHostMsg_FrameNavigate_Params& params) { 1601 const ViewHostMsg_FrameNavigate_Params& params) {
1602 if (opener_dom_ui_type_ != DOMUIFactory::kNoDOMUI) { 1602 if (opener_dom_ui_type_ != DOMUIFactory::kNoDOMUI) {
1603 // If this is a window.open navigation, use the same DOMUI as the renderer 1603 // If this is a window.open navigation, use the same DOMUI as the renderer
1604 // that opened the window, as long as both renderers have the same 1604 // that opened the window, as long as both renderers have the same
1605 // privileges. 1605 // privileges.
1606 if (opener_dom_ui_type_ == DOMUIFactory::GetDOMUIType(GetURL())) { 1606 if (opener_dom_ui_type_ ==
1607 DOMUIFactory::GetDOMUIType(profile(), GetURL())) {
1607 DOMUI* dom_ui = DOMUIFactory::CreateDOMUIForURL(this, GetURL()); 1608 DOMUI* dom_ui = DOMUIFactory::CreateDOMUIForURL(this, GetURL());
1608 // dom_ui might be NULL if the URL refers to a non-existent extension. 1609 // dom_ui might be NULL if the URL refers to a non-existent extension.
1609 if (dom_ui) { 1610 if (dom_ui) {
1610 render_manager_.SetDOMUIPostCommit(dom_ui); 1611 render_manager_.SetDOMUIPostCommit(dom_ui);
1611 dom_ui->RenderViewCreated(render_view_host()); 1612 dom_ui->RenderViewCreated(render_view_host());
1612 } 1613 }
1613 } 1614 }
1614 opener_dom_ui_type_ = DOMUIFactory::kNoDOMUI; 1615 opener_dom_ui_type_ = DOMUIFactory::kNoDOMUI;
1615 } 1616 }
1616 1617
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after
3240 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); 3241 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save));
3241 } 3242 }
3242 3243
3243 Profile* TabContents::GetProfileForPasswordManager() { 3244 Profile* TabContents::GetProfileForPasswordManager() {
3244 return profile(); 3245 return profile();
3245 } 3246 }
3246 3247
3247 bool TabContents::DidLastPageLoadEncounterSSLErrors() { 3248 bool TabContents::DidLastPageLoadEncounterSSLErrors() {
3248 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); 3249 return controller().ssl_manager()->ProcessedSSLErrorFromRequest();
3249 } 3250 }
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