| 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_wrapper.h" | 5 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.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/content_settings/tab_specific_content_settings.h" | 13 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 14 #include "chrome/browser/download/download_request_limiter_observer.h" | 14 #include "chrome/browser/download/download_request_limiter_observer.h" |
| 15 #include "chrome/browser/extensions/extension_tab_helper.h" | 15 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 16 #include "chrome/browser/extensions/extension_webnavigation_api.h" | 16 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.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/omnibox_search_hint.h" | 21 #include "chrome/browser/omnibox_search_hint.h" |
| 22 #include "chrome/browser/password_manager/password_manager.h" | 22 #include "chrome/browser/password_manager/password_manager.h" |
| 23 #include "chrome/browser/password_manager_delegate_impl.h" | 23 #include "chrome/browser/password_manager_delegate_impl.h" |
| 24 #include "chrome/browser/plugin_observer.h" | 24 #include "chrome/browser/plugin_observer.h" |
| 25 #include "chrome/browser/prerender/prerender_tab_helper.h" | 25 #include "chrome/browser/prerender/prerender_tab_helper.h" |
| 26 #include "chrome/browser/printing/print_preview_message_handler.h" | 26 #include "chrome/browser/printing/print_preview_message_handler.h" |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 print_view_manager_.reset(new printing::PrintViewManager(this)); | 114 print_view_manager_.reset(new printing::PrintViewManager(this)); |
| 115 sad_tab_helper_.reset(new SadTabHelper(contents)); | 115 sad_tab_helper_.reset(new SadTabHelper(contents)); |
| 116 #endif | 116 #endif |
| 117 | 117 |
| 118 // Create the per-tab observers. | 118 // Create the per-tab observers. |
| 119 alternate_error_page_tab_observer_.reset( | 119 alternate_error_page_tab_observer_.reset( |
| 120 new AlternateErrorPageTabObserver(contents)); | 120 new AlternateErrorPageTabObserver(contents)); |
| 121 download_request_limiter_observer_.reset( | 121 download_request_limiter_observer_.reset( |
| 122 new DownloadRequestLimiterObserver(contents)); | 122 new DownloadRequestLimiterObserver(contents)); |
| 123 webnavigation_observer_.reset( | 123 webnavigation_observer_.reset( |
| 124 new ExtensionWebNavigationTabObserver(contents)); | 124 new extensions::WebNavigationTabObserver(contents)); |
| 125 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); | 125 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); |
| 126 if (OmniboxSearchHint::IsEnabled(profile())) | 126 if (OmniboxSearchHint::IsEnabled(profile())) |
| 127 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); | 127 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); |
| 128 pdf_tab_observer_.reset(new PDFTabObserver(this)); | 128 pdf_tab_observer_.reset(new PDFTabObserver(this)); |
| 129 plugin_observer_.reset(new PluginObserver(this)); | 129 plugin_observer_.reset(new PluginObserver(this)); |
| 130 safe_browsing_tab_observer_.reset( | 130 safe_browsing_tab_observer_.reset( |
| 131 new safe_browsing::SafeBrowsingTabObserver(this)); | 131 new safe_browsing::SafeBrowsingTabObserver(this)); |
| 132 | 132 |
| 133 #if !defined(OS_ANDROID) | 133 #if !defined(OS_ANDROID) |
| 134 print_preview_.reset(new printing::PrintPreviewMessageHandler(contents)); | 134 print_preview_.reset(new printing::PrintPreviewMessageHandler(contents)); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 204 |
| 205 //////////////////////////////////////////////////////////////////////////////// | 205 //////////////////////////////////////////////////////////////////////////////// |
| 206 // WebContentsObserver overrides | 206 // WebContentsObserver overrides |
| 207 | 207 |
| 208 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { | 208 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { |
| 209 // Destruction of the WebContents should only be done by us from our | 209 // Destruction of the WebContents should only be done by us from our |
| 210 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 210 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
| 211 // will attempt to access the TabContents and we'll crash. | 211 // will attempt to access the TabContents and we'll crash. |
| 212 DCHECK(in_destructor_); | 212 DCHECK(in_destructor_); |
| 213 } | 213 } |
| OLD | NEW |