| 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/password_manager_delegate_impl.h" | 22 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" |
| 24 #include "chrome/browser/plugin_observer.h" | 23 #include "chrome/browser/plugin_observer.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 web_intent_picker_controller_.reset(new WebIntentPickerController(this)); | 118 web_intent_picker_controller_.reset(new WebIntentPickerController(this)); |
| 120 | 119 |
| 121 #if !defined(OS_ANDROID) | 120 #if !defined(OS_ANDROID) |
| 122 print_view_manager_.reset(new printing::PrintViewManager(this)); | 121 print_view_manager_.reset(new printing::PrintViewManager(this)); |
| 123 sad_tab_helper_.reset(new SadTabHelper(contents)); | 122 sad_tab_helper_.reset(new SadTabHelper(contents)); |
| 124 #endif | 123 #endif |
| 125 | 124 |
| 126 // Create the per-tab observers. | 125 // Create the per-tab observers. |
| 127 alternate_error_page_tab_observer_.reset( | 126 alternate_error_page_tab_observer_.reset( |
| 128 new AlternateErrorPageTabObserver(contents, profile())); | 127 new AlternateErrorPageTabObserver(contents, profile())); |
| 129 download_request_limiter_observer_.reset( | |
| 130 new DownloadRequestLimiterObserver(contents)); | |
| 131 webnavigation_observer_.reset( | 128 webnavigation_observer_.reset( |
| 132 new extensions::WebNavigationTabObserver(contents)); | 129 new extensions::WebNavigationTabObserver(contents)); |
| 133 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); | 130 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); |
| 134 pdf_tab_observer_.reset(new PDFTabObserver(this)); | 131 pdf_tab_observer_.reset(new PDFTabObserver(this)); |
| 135 safe_browsing_tab_observer_.reset( | 132 safe_browsing_tab_observer_.reset( |
| 136 new safe_browsing::SafeBrowsingTabObserver(this)); | 133 new safe_browsing::SafeBrowsingTabObserver(this)); |
| 137 | 134 |
| 138 #if defined(OS_WIN) | 135 #if defined(OS_WIN) |
| 139 // Metro mode Chrome on Windows does not support plugins. Avoid registering | 136 // Metro mode Chrome on Windows does not support plugins. Avoid registering |
| 140 // the PluginObserver so we don't popup plugin-related infobars. | 137 // the PluginObserver so we don't popup plugin-related infobars. |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 222 |
| 226 //////////////////////////////////////////////////////////////////////////////// | 223 //////////////////////////////////////////////////////////////////////////////// |
| 227 // WebContentsObserver overrides | 224 // WebContentsObserver overrides |
| 228 | 225 |
| 229 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { | 226 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { |
| 230 // Destruction of the WebContents should only be done by us from our | 227 // Destruction of the WebContents should only be done by us from our |
| 231 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 228 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
| 232 // will attempt to access the WebContents and we'll crash. | 229 // will attempt to access the WebContents and we'll crash. |
| 233 DCHECK(in_destructor_); | 230 DCHECK(in_destructor_); |
| 234 } | 231 } |
| OLD | NEW |