OLD | NEW |
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 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 NavigationController::ReloadType reload_type) { | 858 NavigationController::ReloadType reload_type) { |
859 RenderViewHost* dest_render_view_host = render_manager_.Navigate(entry); | 859 RenderViewHost* dest_render_view_host = render_manager_.Navigate(entry); |
860 if (!dest_render_view_host) | 860 if (!dest_render_view_host) |
861 return false; // Unable to create the desired render view host. | 861 return false; // Unable to create the desired render view host. |
862 | 862 |
863 if (delegate_ && delegate_->ShouldEnablePreferredSizeNotifications()) { | 863 if (delegate_ && delegate_->ShouldEnablePreferredSizeNotifications()) { |
864 dest_render_view_host->EnablePreferredSizeChangedMode( | 864 dest_render_view_host->EnablePreferredSizeChangedMode( |
865 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow); | 865 kPreferredSizeWidth | kPreferredSizeHeightThisIsSlow); |
866 } | 866 } |
867 | 867 |
868 // For security, we should never send non-DOM-UI URLs (other than about:blank) | 868 // For security, we should never send non-DOM-UI URLs to a DOM UI renderer. |
869 // to a DOM UI renderer. Double check that here. | 869 // Double check that here. |
870 int enabled_bindings = dest_render_view_host->enabled_bindings(); | 870 int enabled_bindings = dest_render_view_host->enabled_bindings(); |
871 bool is_allowed_in_dom_ui_renderer = | 871 bool is_allowed_in_dom_ui_renderer = |
872 DOMUIFactory::UseDOMUIForURL(profile(), entry.url()) || | 872 DOMUIFactory::IsURLAcceptableForDOMUI(profile(), entry.url()); |
873 entry.url() == GURL(chrome::kAboutBlankURL); | |
874 CHECK(!BindingsPolicy::is_dom_ui_enabled(enabled_bindings) || | 873 CHECK(!BindingsPolicy::is_dom_ui_enabled(enabled_bindings) || |
875 is_allowed_in_dom_ui_renderer); | 874 is_allowed_in_dom_ui_renderer); |
876 | 875 |
877 // Tell DevTools agent that it is attached prior to the navigation. | 876 // Tell DevTools agent that it is attached prior to the navigation. |
878 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); | 877 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); |
879 if (devtools_manager) { // NULL in unit tests. | 878 if (devtools_manager) { // NULL in unit tests. |
880 devtools_manager->OnNavigatingToPendingEntry(render_view_host(), | 879 devtools_manager->OnNavigatingToPendingEntry(render_view_host(), |
881 dest_render_view_host, | 880 dest_render_view_host, |
882 entry.url()); | 881 entry.url()); |
883 } | 882 } |
(...skipping 2449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3333 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); | 3332 AddInfoBar(new SavePasswordInfoBarDelegate(this, form_to_save)); |
3334 } | 3333 } |
3335 | 3334 |
3336 Profile* TabContents::GetProfileForPasswordManager() { | 3335 Profile* TabContents::GetProfileForPasswordManager() { |
3337 return profile(); | 3336 return profile(); |
3338 } | 3337 } |
3339 | 3338 |
3340 bool TabContents::DidLastPageLoadEncounterSSLErrors() { | 3339 bool TabContents::DidLastPageLoadEncounterSSLErrors() { |
3341 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); | 3340 return controller().ssl_manager()->ProcessedSSLErrorFromRequest(); |
3342 } | 3341 } |
OLD | NEW |