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