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/autocomplete_history_manager.h" | 9 #include "chrome/browser/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/extension_tab_helper.h" | 16 #include "chrome/browser/extensions/extension_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/omnibox_search_hint.h" | 22 #include "chrome/browser/omnibox_search_hint.h" |
22 #include "chrome/browser/password_manager/password_manager.h" | 23 #include "chrome/browser/password_manager/password_manager.h" |
23 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" | 24 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" |
24 #include "chrome/browser/plugin_observer.h" | 25 #include "chrome/browser/plugin_observer.h" |
25 #include "chrome/browser/prerender/prerender_tab_helper.h" | 26 #include "chrome/browser/prerender/prerender_tab_helper.h" |
26 #include "chrome/browser/printing/print_preview_message_handler.h" | 27 #include "chrome/browser/printing/print_preview_message_handler.h" |
27 #include "chrome/browser/printing/print_view_manager.h" | 28 #include "chrome/browser/printing/print_view_manager.h" |
28 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" | 29 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" |
29 #include "chrome/browser/sessions/restore_tab_helper.h" | 30 #include "chrome/browser/sessions/restore_tab_helper.h" |
30 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" | 31 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 AutofillExternalDelegate::Create(this, autofill_manager_.get())); | 90 AutofillExternalDelegate::Create(this, autofill_manager_.get())); |
90 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); | 91 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); |
91 autocomplete_history_manager_->SetExternalDelegate( | 92 autocomplete_history_manager_->SetExternalDelegate( |
92 autofill_external_delegate_.get()); | 93 autofill_external_delegate_.get()); |
93 } | 94 } |
94 #if defined(ENABLE_AUTOMATION) | 95 #if defined(ENABLE_AUTOMATION) |
95 automation_tab_helper_.reset(new AutomationTabHelper(contents)); | 96 automation_tab_helper_.reset(new AutomationTabHelper(contents)); |
96 #endif | 97 #endif |
97 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); | 98 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); |
98 bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); | 99 bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); |
| 100 cache_stats_tab_helper_.reset( |
| 101 new chrome_browser_net::CacheStatsTabHelper(this)); |
99 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 102 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
100 captive_portal_tab_helper_.reset( | 103 captive_portal_tab_helper_.reset( |
101 new captive_portal::CaptivePortalTabHelper(profile(), web_contents())); | 104 new captive_portal::CaptivePortalTabHelper(profile(), web_contents())); |
102 #endif | 105 #endif |
103 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); | 106 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); |
104 core_tab_helper_.reset(new CoreTabHelper(contents)); | 107 core_tab_helper_.reset(new CoreTabHelper(contents)); |
105 extension_tab_helper_.reset(new ExtensionTabHelper(this)); | 108 extension_tab_helper_.reset(new ExtensionTabHelper(this)); |
106 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); | 109 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); |
107 find_tab_helper_.reset(new FindTabHelper(contents)); | 110 find_tab_helper_.reset(new FindTabHelper(contents)); |
108 history_tab_helper_.reset(new HistoryTabHelper(contents)); | 111 history_tab_helper_.reset(new HistoryTabHelper(contents)); |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 237 |
235 //////////////////////////////////////////////////////////////////////////////// | 238 //////////////////////////////////////////////////////////////////////////////// |
236 // WebContentsObserver overrides | 239 // WebContentsObserver overrides |
237 | 240 |
238 void TabContents::WebContentsDestroyed(WebContents* tab) { | 241 void TabContents::WebContentsDestroyed(WebContents* tab) { |
239 // Destruction of the WebContents should only be done by us from our | 242 // Destruction of the WebContents should only be done by us from our |
240 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 243 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
241 // will attempt to access the WebContents and we'll crash. | 244 // will attempt to access the WebContents and we'll crash. |
242 DCHECK(in_destructor_); | 245 DCHECK(in_destructor_); |
243 } | 246 } |
OLD | NEW |