| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_tab_contents.h" | 5 #include "chrome/browser/ui/browser_tab_contents.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 10 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | 10 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/ui/hung_plugin_tab_helper.h" | 36 #include "chrome/browser/ui/hung_plugin_tab_helper.h" |
| 37 #include "chrome/browser/ui/pdf/pdf_tab_helper.h" | 37 #include "chrome/browser/ui/pdf/pdf_tab_helper.h" |
| 38 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" | 38 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
| 39 #include "chrome/browser/ui/sad_tab_helper.h" | 39 #include "chrome/browser/ui/sad_tab_helper.h" |
| 40 #include "chrome/browser/ui/search/search_tab_helper.h" | 40 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 41 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" | 41 #include "chrome/browser/ui/search_engines/search_engine_tab_helper.h" |
| 42 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" | 42 #include "chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h" |
| 43 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 43 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 44 #include "chrome/browser/ui/zoom/zoom_controller.h" | 44 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| 45 #include "chrome/common/chrome_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
| 46 #include "components/autofill/browser/autofill_external_delegate.h" | |
| 47 #include "components/autofill/browser/autofill_manager.h" | 46 #include "components/autofill/browser/autofill_manager.h" |
| 47 #include "components/autofill/content/browser/autofill_driver.h" |
| 48 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 48 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 49 #include "content/public/browser/web_contents.h" | 49 #include "content/public/browser/web_contents.h" |
| 50 #include "extensions/browser/view_type_utils.h" | 50 #include "extensions/browser/view_type_utils.h" |
| 51 | 51 |
| 52 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 52 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 53 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" | 53 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 #if defined(ENABLE_MANAGED_USERS) | 56 #if defined(ENABLE_MANAGED_USERS) |
| 57 #include "chrome/browser/managed_mode/managed_mode_navigation_observer.h" | 57 #include "chrome/browser/managed_mode/managed_mode_navigation_observer.h" |
| 58 #include "chrome/browser/managed_mode/managed_user_service.h" | 58 #include "chrome/browser/managed_mode/managed_user_service.h" |
| 59 #endif | 59 #endif |
| 60 | 60 |
| 61 #if defined(ENABLE_PRINTING) | 61 #if defined(ENABLE_PRINTING) |
| 62 #include "chrome/browser/printing/print_preview_message_handler.h" | 62 #include "chrome/browser/printing/print_preview_message_handler.h" |
| 63 #include "chrome/browser/printing/print_view_manager.h" | 63 #include "chrome/browser/printing/print_view_manager.h" |
| 64 #endif | 64 #endif |
| 65 | 65 |
| 66 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 66 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
| 67 #include "chrome/browser/ui/sync/one_click_signin_helper.h" | 67 #include "chrome/browser/ui/sync/one_click_signin_helper.h" |
| 68 #endif | 68 #endif |
| 69 | 69 |
| 70 #if defined(OS_WIN) | 70 #if defined(OS_WIN) |
| 71 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" | 71 #include "chrome/browser/ui/metro_pin_tab_helper_win.h" |
| 72 #endif | 72 #endif |
| 73 | 73 |
| 74 using autofill::AutofillExternalDelegate; | 74 using autofill::AutofillDriver; |
| 75 using autofill::AutofillManager; | 75 using autofill::AutofillManager; |
| 76 using autofill::TabAutofillManagerDelegate; | 76 using autofill::TabAutofillManagerDelegate; |
| 77 using content::WebContents; | 77 using content::WebContents; |
| 78 using web_modal::WebContentsModalDialogManager; | 78 using web_modal::WebContentsModalDialogManager; |
| 79 | 79 |
| 80 namespace { | 80 namespace { |
| 81 | 81 |
| 82 const char kTabContentsAttachedTabHelpersUserDataKey[] = | 82 const char kTabContentsAttachedTabHelpersUserDataKey[] = |
| 83 "TabContentsAttachedTabHelpers"; | 83 "TabContentsAttachedTabHelpers"; |
| 84 | 84 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 103 | 103 |
| 104 Profile* profile = | 104 Profile* profile = |
| 105 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 105 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 106 | 106 |
| 107 // SessionTabHelper comes first because it sets up the tab ID, and other | 107 // SessionTabHelper comes first because it sets up the tab ID, and other |
| 108 // helpers may rely on that. | 108 // helpers may rely on that. |
| 109 SessionTabHelper::CreateForWebContents(web_contents); | 109 SessionTabHelper::CreateForWebContents(web_contents); |
| 110 | 110 |
| 111 AlternateErrorPageTabObserver::CreateForWebContents(web_contents); | 111 AlternateErrorPageTabObserver::CreateForWebContents(web_contents); |
| 112 TabAutofillManagerDelegate::CreateForWebContents(web_contents); | 112 TabAutofillManagerDelegate::CreateForWebContents(web_contents); |
| 113 AutofillManager::CreateForWebContentsAndDelegate( | 113 bool native_autofill_ui_enabled = |
| 114 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 115 switches::kDisableNativeAutofillUi); |
| 116 AutofillDriver::CreateForWebContentsAndDelegate( |
| 114 web_contents, | 117 web_contents, |
| 115 TabAutofillManagerDelegate::FromWebContents(web_contents), | 118 TabAutofillManagerDelegate::FromWebContents(web_contents), |
| 116 g_browser_process->GetApplicationLocale(), | 119 g_browser_process->GetApplicationLocale(), |
| 117 AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER); | 120 AutofillManager::ENABLE_AUTOFILL_DOWNLOAD_MANAGER, |
| 118 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 121 native_autofill_ui_enabled); |
| 119 switches::kDisableNativeAutofillUi)) { | |
| 120 AutofillExternalDelegate::CreateForWebContentsAndManager( | |
| 121 web_contents, AutofillManager::FromWebContents(web_contents)); | |
| 122 AutofillManager::FromWebContents(web_contents)->SetExternalDelegate( | |
| 123 AutofillExternalDelegate::FromWebContents(web_contents)); | |
| 124 } | |
| 125 BlockedContentTabHelper::CreateForWebContents(web_contents); | 122 BlockedContentTabHelper::CreateForWebContents(web_contents); |
| 126 BookmarkTabHelper::CreateForWebContents(web_contents); | 123 BookmarkTabHelper::CreateForWebContents(web_contents); |
| 127 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents( | 124 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents( |
| 128 web_contents); | 125 web_contents); |
| 129 chrome_browser_net::NetErrorTabHelper::CreateForWebContents(web_contents); | 126 chrome_browser_net::NetErrorTabHelper::CreateForWebContents(web_contents); |
| 130 WebContentsModalDialogManager::CreateForWebContents(web_contents); | 127 WebContentsModalDialogManager::CreateForWebContents(web_contents); |
| 131 CoreTabHelper::CreateForWebContents(web_contents); | 128 CoreTabHelper::CreateForWebContents(web_contents); |
| 132 extensions::TabHelper::CreateForWebContents(web_contents); | 129 extensions::TabHelper::CreateForWebContents(web_contents); |
| 133 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); | 130 extensions::WebNavigationTabObserver::CreateForWebContents(web_contents); |
| 134 ExternalProtocolObserver::CreateForWebContents(web_contents); | 131 ExternalProtocolObserver::CreateForWebContents(web_contents); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 std::string(), | 181 std::string(), |
| 185 NULL)) { | 182 NULL)) { |
| 186 OneClickSigninHelper::CreateForWebContents(web_contents); | 183 OneClickSigninHelper::CreateForWebContents(web_contents); |
| 187 } | 184 } |
| 188 #endif | 185 #endif |
| 189 | 186 |
| 190 #if defined(OS_WIN) | 187 #if defined(OS_WIN) |
| 191 MetroPinTabHelper::CreateForWebContents(web_contents); | 188 MetroPinTabHelper::CreateForWebContents(web_contents); |
| 192 #endif | 189 #endif |
| 193 } | 190 } |
| OLD | NEW |