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" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "chrome/browser/printing/print_view_manager.h" | 28 #include "chrome/browser/printing/print_view_manager.h" |
29 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" | 29 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" |
30 #include "chrome/browser/sessions/restore_tab_helper.h" | 30 #include "chrome/browser/sessions/restore_tab_helper.h" |
31 #include "chrome/browser/sessions/session_service.h" | 31 #include "chrome/browser/sessions/session_service.h" |
32 #include "chrome/browser/sessions/session_service_factory.h" | 32 #include "chrome/browser/sessions/session_service_factory.h" |
33 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" | 33 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" |
34 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" | 34 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" |
35 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 35 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
36 #include "chrome/browser/translate/translate_tab_helper.h" | 36 #include "chrome/browser/translate/translate_tab_helper.h" |
37 #include "chrome/browser/ui/alternate_error_tab_observer.h" | 37 #include "chrome/browser/ui/alternate_error_tab_observer.h" |
| 38 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" |
38 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 39 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
39 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 40 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
40 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 41 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
41 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 42 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
42 #include "chrome/browser/ui/hung_plugin_tab_helper.h" | 43 #include "chrome/browser/ui/hung_plugin_tab_helper.h" |
43 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" | 44 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
44 #include "chrome/browser/ui/metro_pin_tab_helper.h" | 45 #include "chrome/browser/ui/metro_pin_tab_helper.h" |
45 #include "chrome/browser/ui/pdf/pdf_tab_observer.h" | 46 #include "chrome/browser/ui/pdf/pdf_tab_observer.h" |
46 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" | 47 #include "chrome/browser/ui/prefs/prefs_tab_helper.h" |
47 #include "chrome/browser/ui/sad_tab_helper.h" | 48 #include "chrome/browser/ui/sad_tab_helper.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 // Stash this in the WebContents. | 105 // Stash this in the WebContents. |
105 contents->SetUserData(&kTabContentsUserDataKey, | 106 contents->SetUserData(&kTabContentsUserDataKey, |
106 new TabContentsUserData(this)); | 107 new TabContentsUserData(this)); |
107 | 108 |
108 // Create the tab helpers. | 109 // Create the tab helpers. |
109 // restore_tab_helper because it sets up the tab ID, and other helpers may | 110 // restore_tab_helper because it sets up the tab ID, and other helpers may |
110 // rely on that. | 111 // rely on that. |
111 restore_tab_helper_.reset(new RestoreTabHelper(contents)); | 112 restore_tab_helper_.reset(new RestoreTabHelper(contents)); |
112 | 113 |
113 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); | 114 autocomplete_history_manager_.reset(new AutocompleteHistoryManager(contents)); |
114 autofill_manager_ = new AutofillManager(this); | 115 autofill_delegate_.reset(new TabAutofillManagerDelegate(this)); |
| 116 autofill_manager_ = new AutofillManager(autofill_delegate_.get(), this); |
115 if (CommandLine::ForCurrentProcess()->HasSwitch( | 117 if (CommandLine::ForCurrentProcess()->HasSwitch( |
116 switches::kExternalAutofillPopup)) { | 118 switches::kExternalAutofillPopup)) { |
117 autofill_external_delegate_.reset( | 119 autofill_external_delegate_.reset( |
118 AutofillExternalDelegate::Create(this, autofill_manager_.get())); | 120 AutofillExternalDelegate::Create(this, autofill_manager_.get())); |
119 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); | 121 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); |
120 autocomplete_history_manager_->SetExternalDelegate( | 122 autocomplete_history_manager_->SetExternalDelegate( |
121 autofill_external_delegate_.get()); | 123 autofill_external_delegate_.get()); |
122 } | 124 } |
123 #if defined(ENABLE_AUTOMATION) | 125 #if defined(ENABLE_AUTOMATION) |
124 automation_tab_helper_.reset(new AutomationTabHelper(contents)); | 126 automation_tab_helper_.reset(new AutomationTabHelper(contents)); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 #if defined(ENABLE_SESSION_SERVICE) | 276 #if defined(ENABLE_SESSION_SERVICE) |
275 SessionService* session = | 277 SessionService* session = |
276 SessionServiceFactory::GetForProfile(profile()); | 278 SessionServiceFactory::GetForProfile(profile()); |
277 if (session) { | 279 if (session) { |
278 session->SetTabUserAgentOverride(restore_tab_helper()->window_id(), | 280 session->SetTabUserAgentOverride(restore_tab_helper()->window_id(), |
279 restore_tab_helper()->session_id(), | 281 restore_tab_helper()->session_id(), |
280 user_agent); | 282 user_agent); |
281 } | 283 } |
282 #endif | 284 #endif |
283 } | 285 } |
OLD | NEW |