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/content_settings/tab_specific_content_settings.h" | 14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
15 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | 15 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
16 #include "chrome/browser/extensions/tab_helper.h" | 16 #include "chrome/browser/extensions/tab_helper.h" |
17 #include "chrome/browser/external_protocol/external_protocol_observer.h" | 17 #include "chrome/browser/external_protocol/external_protocol_observer.h" |
18 #include "chrome/browser/favicon/favicon_tab_helper.h" | 18 #include "chrome/browser/favicon/favicon_tab_helper.h" |
19 #include "chrome/browser/history/history_tab_helper.h" | 19 #include "chrome/browser/history/history_tab_helper.h" |
20 #include "chrome/browser/infobars/infobar_tab_helper.h" | 20 #include "chrome/browser/infobars/infobar_tab_helper.h" |
21 #include "chrome/browser/net/cache_stats.h" | 21 #include "chrome/browser/net/load_time_stats.h" |
22 #include "chrome/browser/omnibox_search_hint.h" | 22 #include "chrome/browser/omnibox_search_hint.h" |
23 #include "chrome/browser/password_manager/password_manager.h" | 23 #include "chrome/browser/password_manager/password_manager.h" |
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/tab_contents/navigation_metrics_recorder.h" | 31 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 AutofillExternalDelegate::Create(this, autofill_manager_.get())); | 96 AutofillExternalDelegate::Create(this, autofill_manager_.get())); |
97 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); | 97 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); |
98 autocomplete_history_manager_->SetExternalDelegate( | 98 autocomplete_history_manager_->SetExternalDelegate( |
99 autofill_external_delegate_.get()); | 99 autofill_external_delegate_.get()); |
100 } | 100 } |
101 #if defined(ENABLE_AUTOMATION) | 101 #if defined(ENABLE_AUTOMATION) |
102 automation_tab_helper_.reset(new AutomationTabHelper(contents)); | 102 automation_tab_helper_.reset(new AutomationTabHelper(contents)); |
103 #endif | 103 #endif |
104 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); | 104 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); |
105 bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); | 105 bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); |
106 cache_stats_tab_helper_.reset( | 106 load_time_stats_tab_helper_.reset( |
107 new chrome_browser_net::CacheStatsTabHelper(this)); | 107 new chrome_browser_net::LoadTimeStatsTabHelper(this)); |
108 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 108 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
109 captive_portal_tab_helper_.reset( | 109 captive_portal_tab_helper_.reset( |
110 new captive_portal::CaptivePortalTabHelper(profile(), web_contents())); | 110 new captive_portal::CaptivePortalTabHelper(profile(), web_contents())); |
111 #endif | 111 #endif |
112 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); | 112 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); |
113 core_tab_helper_.reset(new CoreTabHelper(contents)); | 113 core_tab_helper_.reset(new CoreTabHelper(contents)); |
114 extension_tab_helper_.reset(new extensions::TabHelper(this)); | 114 extension_tab_helper_.reset(new extensions::TabHelper(this)); |
115 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); | 115 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); |
116 find_tab_helper_.reset(new FindTabHelper(contents)); | 116 find_tab_helper_.reset(new FindTabHelper(contents)); |
117 history_tab_helper_.reset(new HistoryTabHelper(contents)); | 117 history_tab_helper_.reset(new HistoryTabHelper(contents)); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 244 |
245 //////////////////////////////////////////////////////////////////////////////// | 245 //////////////////////////////////////////////////////////////////////////////// |
246 // WebContentsObserver overrides | 246 // WebContentsObserver overrides |
247 | 247 |
248 void TabContents::WebContentsDestroyed(WebContents* tab) { | 248 void TabContents::WebContentsDestroyed(WebContents* tab) { |
249 // Destruction of the WebContents should only be done by us from our | 249 // Destruction of the WebContents should only be done by us from our |
250 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 250 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
251 // will attempt to access the WebContents and we'll crash. | 251 // will attempt to access the WebContents and we'll crash. |
252 DCHECK(in_destructor_); | 252 DCHECK(in_destructor_); |
253 } | 253 } |
OLD | NEW |