| 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" | |
| 15 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | 14 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" |
| 16 #include "chrome/browser/extensions/extension_tab_helper.h" | 15 #include "chrome/browser/extensions/extension_tab_helper.h" |
| 17 #include "chrome/browser/external_protocol/external_protocol_observer.h" | 16 #include "chrome/browser/external_protocol/external_protocol_observer.h" |
| 18 #include "chrome/browser/favicon/favicon_tab_helper.h" | 17 #include "chrome/browser/favicon/favicon_tab_helper.h" |
| 19 #include "chrome/browser/history/history_tab_helper.h" | 18 #include "chrome/browser/history/history_tab_helper.h" |
| 20 #include "chrome/browser/infobars/infobar_tab_helper.h" | 19 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 21 #include "chrome/browser/omnibox_search_hint.h" | 20 #include "chrome/browser/omnibox_search_hint.h" |
| 22 #include "chrome/browser/password_manager/password_manager.h" | 21 #include "chrome/browser/password_manager/password_manager.h" |
| 23 #include "chrome/browser/password_manager_delegate_impl.h" | 22 #include "chrome/browser/password_manager_delegate_impl.h" |
| 24 #include "chrome/browser/plugin_observer.h" | 23 #include "chrome/browser/plugin_observer.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 web_intent_picker_controller_.reset(new WebIntentPickerController(this)); | 112 web_intent_picker_controller_.reset(new WebIntentPickerController(this)); |
| 114 | 113 |
| 115 #if !defined(OS_ANDROID) | 114 #if !defined(OS_ANDROID) |
| 116 print_view_manager_.reset(new printing::PrintViewManager(this)); | 115 print_view_manager_.reset(new printing::PrintViewManager(this)); |
| 117 sad_tab_helper_.reset(new SadTabHelper(contents)); | 116 sad_tab_helper_.reset(new SadTabHelper(contents)); |
| 118 #endif | 117 #endif |
| 119 | 118 |
| 120 // Create the per-tab observers. | 119 // Create the per-tab observers. |
| 121 alternate_error_page_tab_observer_.reset( | 120 alternate_error_page_tab_observer_.reset( |
| 122 new AlternateErrorPageTabObserver(contents, profile())); | 121 new AlternateErrorPageTabObserver(contents, profile())); |
| 123 download_request_limiter_observer_.reset( | |
| 124 new DownloadRequestLimiterObserver(contents)); | |
| 125 webnavigation_observer_.reset( | 122 webnavigation_observer_.reset( |
| 126 new extensions::WebNavigationTabObserver(contents)); | 123 new extensions::WebNavigationTabObserver(contents)); |
| 127 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); | 124 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); |
| 128 pdf_tab_observer_.reset(new PDFTabObserver(this)); | 125 pdf_tab_observer_.reset(new PDFTabObserver(this)); |
| 129 plugin_observer_.reset(new PluginObserver(this)); | 126 plugin_observer_.reset(new PluginObserver(this)); |
| 130 safe_browsing_tab_observer_.reset( | 127 safe_browsing_tab_observer_.reset( |
| 131 new safe_browsing::SafeBrowsingTabObserver(this)); | 128 new safe_browsing::SafeBrowsingTabObserver(this)); |
| 132 | 129 |
| 133 #if !defined(OS_ANDROID) | 130 #if !defined(OS_ANDROID) |
| 134 if (OmniboxSearchHint::IsEnabled(profile())) | 131 if (OmniboxSearchHint::IsEnabled(profile())) |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 | 203 |
| 207 //////////////////////////////////////////////////////////////////////////////// | 204 //////////////////////////////////////////////////////////////////////////////// |
| 208 // WebContentsObserver overrides | 205 // WebContentsObserver overrides |
| 209 | 206 |
| 210 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { | 207 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { |
| 211 // Destruction of the WebContents should only be done by us from our | 208 // Destruction of the WebContents should only be done by us from our |
| 212 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 209 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
| 213 // will attempt to access the WebContents and we'll crash. | 210 // will attempt to access the WebContents and we'll crash. |
| 214 DCHECK(in_destructor_); | 211 DCHECK(in_destructor_); |
| 215 } | 212 } |
| OLD | NEW |