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 13 matching lines...) Expand all Loading... |
24 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" | 24 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" |
25 #include "chrome/browser/plugin_observer.h" | 25 #include "chrome/browser/plugin_observer.h" |
26 #include "chrome/browser/prerender/prerender_tab_helper.h" | 26 #include "chrome/browser/prerender/prerender_tab_helper.h" |
27 #include "chrome/browser/printing/print_preview_message_handler.h" | 27 #include "chrome/browser/printing/print_preview_message_handler.h" |
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_autofill_manager_delegate.h" |
34 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" | 35 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" |
35 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 36 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
36 #include "chrome/browser/translate/translate_tab_helper.h" | 37 #include "chrome/browser/translate/translate_tab_helper.h" |
37 #include "chrome/browser/ui/alternate_error_tab_observer.h" | 38 #include "chrome/browser/ui/alternate_error_tab_observer.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" |
(...skipping 40 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_delegate_.reset(new TabAutofillManagerDelegate(this)); |
| 96 autofill_manager_ = new AutofillManager(autofill_delegate_.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 |