| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 #include "chrome/browser/profiles/profile_metrics.h" | 70 #include "chrome/browser/profiles/profile_metrics.h" |
| 71 #include "chrome/browser/profiles/profiles_state.h" | 71 #include "chrome/browser/profiles/profiles_state.h" |
| 72 #include "chrome/browser/repost_form_warning_controller.h" | 72 #include "chrome/browser/repost_form_warning_controller.h" |
| 73 #include "chrome/browser/search/search.h" | 73 #include "chrome/browser/search/search.h" |
| 74 #include "chrome/browser/sessions/session_restore.h" | 74 #include "chrome/browser/sessions/session_restore.h" |
| 75 #include "chrome/browser/sessions/session_service.h" | 75 #include "chrome/browser/sessions/session_service.h" |
| 76 #include "chrome/browser/sessions/session_service_factory.h" | 76 #include "chrome/browser/sessions/session_service_factory.h" |
| 77 #include "chrome/browser/sessions/session_tab_helper.h" | 77 #include "chrome/browser/sessions/session_tab_helper.h" |
| 78 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 78 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 79 #include "chrome/browser/ssl/chrome_security_state_model_client.h" | 79 #include "chrome/browser/ssl/chrome_security_state_model_client.h" |
| 80 #include "chrome/browser/ssl/security_state_model.h" | |
| 81 #include "chrome/browser/sync/profile_sync_service_factory.h" | 80 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 82 #include "chrome/browser/sync/sync_ui_util.h" | 81 #include "chrome/browser/sync/sync_ui_util.h" |
| 83 #include "chrome/browser/tab_contents/retargeting_details.h" | 82 #include "chrome/browser/tab_contents/retargeting_details.h" |
| 84 #include "chrome/browser/tab_contents/tab_util.h" | 83 #include "chrome/browser/tab_contents/tab_util.h" |
| 85 #include "chrome/browser/task_management/web_contents_tags.h" | 84 #include "chrome/browser/task_management/web_contents_tags.h" |
| 86 #include "chrome/browser/themes/theme_service.h" | 85 #include "chrome/browser/themes/theme_service.h" |
| 87 #include "chrome/browser/themes/theme_service_factory.h" | 86 #include "chrome/browser/themes/theme_service_factory.h" |
| 88 #include "chrome/browser/translate/chrome_translate_client.h" | 87 #include "chrome/browser/translate/chrome_translate_client.h" |
| 89 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" | 88 #include "chrome/browser/ui/autofill/chrome_autofill_client.h" |
| 90 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 89 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 #include "chrome/grit/locale_settings.h" | 155 #include "chrome/grit/locale_settings.h" |
| 157 #include "components/app_modal/javascript_dialog_manager.h" | 156 #include "components/app_modal/javascript_dialog_manager.h" |
| 158 #include "components/bookmarks/browser/bookmark_model.h" | 157 #include "components/bookmarks/browser/bookmark_model.h" |
| 159 #include "components/bookmarks/browser/bookmark_utils.h" | 158 #include "components/bookmarks/browser/bookmark_utils.h" |
| 160 #include "components/bookmarks/common/bookmark_pref_names.h" | 159 #include "components/bookmarks/common/bookmark_pref_names.h" |
| 161 #include "components/browser_sync/browser/profile_sync_service.h" | 160 #include "components/browser_sync/browser/profile_sync_service.h" |
| 162 #include "components/content_settings/core/browser/host_content_settings_map.h" | 161 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 163 #include "components/favicon/content/content_favicon_driver.h" | 162 #include "components/favicon/content/content_favicon_driver.h" |
| 164 #include "components/history/core/browser/top_sites.h" | 163 #include "components/history/core/browser/top_sites.h" |
| 165 #include "components/search/search.h" | 164 #include "components/search/search.h" |
| 165 #include "components/security_state/security_state_model.h" |
| 166 #include "components/sessions/core/session_types.h" | 166 #include "components/sessions/core/session_types.h" |
| 167 #include "components/sessions/core/tab_restore_service.h" | 167 #include "components/sessions/core/tab_restore_service.h" |
| 168 #include "components/startup_metric_utils/browser/startup_metric_utils.h" | 168 #include "components/startup_metric_utils/browser/startup_metric_utils.h" |
| 169 #include "components/translate/core/browser/language_state.h" | 169 #include "components/translate/core/browser/language_state.h" |
| 170 #include "components/ui/zoom/zoom_controller.h" | 170 #include "components/ui/zoom/zoom_controller.h" |
| 171 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 171 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 172 #include "content/public/browser/devtools_agent_host.h" | 172 #include "content/public/browser/devtools_agent_host.h" |
| 173 #include "content/public/browser/interstitial_page.h" | 173 #include "content/public/browser/interstitial_page.h" |
| 174 #include "content/public/browser/invalidate_type.h" | 174 #include "content/public/browser/invalidate_type.h" |
| 175 #include "content/public/browser/navigation_controller.h" | 175 #include "content/public/browser/navigation_controller.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 using content::NativeWebKeyboardEvent; | 230 using content::NativeWebKeyboardEvent; |
| 231 using content::NavigationController; | 231 using content::NavigationController; |
| 232 using content::NavigationEntry; | 232 using content::NavigationEntry; |
| 233 using content::OpenURLParams; | 233 using content::OpenURLParams; |
| 234 using content::PluginService; | 234 using content::PluginService; |
| 235 using content::Referrer; | 235 using content::Referrer; |
| 236 using content::RenderWidgetHostView; | 236 using content::RenderWidgetHostView; |
| 237 using content::SiteInstance; | 237 using content::SiteInstance; |
| 238 using content::WebContents; | 238 using content::WebContents; |
| 239 using extensions::Extension; | 239 using extensions::Extension; |
| 240 using security_state::SecurityStateModel; |
| 240 using ui::WebDialogDelegate; | 241 using ui::WebDialogDelegate; |
| 241 using web_modal::WebContentsModalDialogManager; | 242 using web_modal::WebContentsModalDialogManager; |
| 242 using blink::WebWindowFeatures; | 243 using blink::WebWindowFeatures; |
| 243 | 244 |
| 244 /////////////////////////////////////////////////////////////////////////////// | 245 /////////////////////////////////////////////////////////////////////////////// |
| 245 | 246 |
| 246 namespace { | 247 namespace { |
| 247 | 248 |
| 248 // How long we wait before updating the browser chrome while loading a page. | 249 // How long we wait before updating the browser chrome while loading a page. |
| 249 const int kUIUpdateCoalescingTimeMS = 200; | 250 const int kUIUpdateCoalescingTimeMS = 200; |
| (...skipping 2459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2709 if (contents && !allow_js_access) { | 2710 if (contents && !allow_js_access) { |
| 2710 contents->web_contents()->GetController().LoadURL( | 2711 contents->web_contents()->GetController().LoadURL( |
| 2711 target_url, | 2712 target_url, |
| 2712 content::Referrer(), | 2713 content::Referrer(), |
| 2713 ui::PAGE_TRANSITION_LINK, | 2714 ui::PAGE_TRANSITION_LINK, |
| 2714 std::string()); // No extra headers. | 2715 std::string()); // No extra headers. |
| 2715 } | 2716 } |
| 2716 | 2717 |
| 2717 return contents != NULL; | 2718 return contents != NULL; |
| 2718 } | 2719 } |
| OLD | NEW |