| 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "chrome/browser/autofill/autocomplete_history_manager.h" | 9 #include "chrome/browser/autofill/autocomplete_history_manager.h" |
| 10 #include "chrome/browser/autofill/autofill_external_delegate.h" | 10 #include "chrome/browser/autofill/autofill_external_delegate.h" |
| 11 #include "chrome/browser/autofill/autofill_manager.h" | 11 #include "chrome/browser/autofill/autofill_manager.h" |
| 12 #include "chrome/browser/automation/automation_tab_helper.h" | 12 #include "chrome/browser/automation/automation_tab_helper.h" |
| 13 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" | 13 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" |
| 14 #include "chrome/browser/chrome_autofill_client.h" |
| 14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 15 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 15 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | 16 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
| 16 #include "chrome/browser/extensions/tab_helper.h" | 17 #include "chrome/browser/extensions/tab_helper.h" |
| 17 #include "chrome/browser/external_protocol/external_protocol_observer.h" | 18 #include "chrome/browser/external_protocol/external_protocol_observer.h" |
| 18 #include "chrome/browser/favicon/favicon_tab_helper.h" | 19 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 19 #include "chrome/browser/history/history_tab_helper.h" | 20 #include "chrome/browser/history/history_tab_helper.h" |
| 20 #include "chrome/browser/infobars/infobar_tab_helper.h" | 21 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 21 #include "chrome/browser/net/load_time_stats.h" | 22 #include "chrome/browser/net/load_time_stats.h" |
| 22 #include "chrome/browser/omnibox_search_hint.h" | 23 #include "chrome/browser/omnibox_search_hint.h" |
| 23 #include "chrome/browser/password_manager/password_manager.h" | 24 #include "chrome/browser/password_manager/password_manager.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // Stash this in the property bag so it can be retrieved without having to | 85 // Stash this in the property bag so it can be retrieved without having to |
| 85 // go to a Browser. | 86 // go to a Browser. |
| 86 property_accessor()->SetProperty(contents->GetPropertyBag(), this); | 87 property_accessor()->SetProperty(contents->GetPropertyBag(), this); |
| 87 | 88 |
| 88 // Create the tab helpers. | 89 // Create the tab helpers. |
| 89 // restore_tab_helper because it sets up the tab ID, and other helpers may | 90 // restore_tab_helper because it sets up the tab ID, and other helpers may |
| 90 // rely on that. | 91 // rely on that. |
| 91 restore_tab_helper_.reset(new RestoreTabHelper(contents)); | 92 restore_tab_helper_.reset(new RestoreTabHelper(contents)); |
| 92 | 93 |
| 93 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); | 94 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); |
| 94 autofill_manager_ = new AutofillManager(this); | 95 autofill_client_.reset(new ChromeAutofillClient(this)); |
| 96 autofill_manager_ = new AutofillManager(autofill_client_.get(), this); |
| 95 if (CommandLine::ForCurrentProcess()->HasSwitch( | 97 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 96 switches::kExternalAutofillPopup)) { | 98 switches::kExternalAutofillPopup)) { |
| 97 autofill_external_delegate_.reset( | 99 autofill_external_delegate_.reset( |
| 98 AutofillExternalDelegate::Create(this, autofill_manager_.get())); | 100 AutofillExternalDelegate::Create(this, autofill_manager_.get())); |
| 99 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); | 101 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); |
| 100 autocomplete_history_manager_->SetExternalDelegate( | 102 autocomplete_history_manager_->SetExternalDelegate( |
| 101 autofill_external_delegate_.get()); | 103 autofill_external_delegate_.get()); |
| 102 } | 104 } |
| 103 #if defined(ENABLE_AUTOMATION) | 105 #if defined(ENABLE_AUTOMATION) |
| 104 automation_tab_helper_.reset(new AutomationTabHelper(contents)); | 106 automation_tab_helper_.reset(new AutomationTabHelper(contents)); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 #if defined(ENABLE_SESSION_SERVICE) | 260 #if defined(ENABLE_SESSION_SERVICE) |
| 259 SessionService* session = | 261 SessionService* session = |
| 260 SessionServiceFactory::GetForProfile(profile()); | 262 SessionServiceFactory::GetForProfile(profile()); |
| 261 if (session) { | 263 if (session) { |
| 262 session->SetTabUserAgentOverride(restore_tab_helper()->window_id(), | 264 session->SetTabUserAgentOverride(restore_tab_helper()->window_id(), |
| 263 restore_tab_helper()->session_id(), | 265 restore_tab_helper()->session_id(), |
| 264 user_agent); | 266 user_agent); |
| 265 } | 267 } |
| 266 #endif | 268 #endif |
| 267 } | 269 } |
| OLD | NEW |