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 #if defined(ENABLE_INPUT_COLOR) |
| 14 #include "chrome/browser/color_select_observer.h" |
| 15 #endif |
13 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 16 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
14 #include "chrome/browser/download/download_request_limiter_observer.h" | 17 #include "chrome/browser/download/download_request_limiter_observer.h" |
15 #include "chrome/browser/extensions/extension_tab_helper.h" | 18 #include "chrome/browser/extensions/extension_tab_helper.h" |
16 #include "chrome/browser/extensions/extension_webnavigation_api.h" | 19 #include "chrome/browser/extensions/extension_webnavigation_api.h" |
17 #include "chrome/browser/external_protocol/external_protocol_observer.h" | 20 #include "chrome/browser/external_protocol/external_protocol_observer.h" |
18 #include "chrome/browser/favicon/favicon_tab_helper.h" | 21 #include "chrome/browser/favicon/favicon_tab_helper.h" |
19 #include "chrome/browser/history/history_tab_helper.h" | 22 #include "chrome/browser/history/history_tab_helper.h" |
20 #include "chrome/browser/infobars/infobar_tab_helper.h" | 23 #include "chrome/browser/infobars/infobar_tab_helper.h" |
21 #include "chrome/browser/omnibox_search_hint.h" | 24 #include "chrome/browser/omnibox_search_hint.h" |
22 #include "chrome/browser/password_manager/password_manager.h" | 25 #include "chrome/browser/password_manager/password_manager.h" |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 ssl_helper_.reset(new TabContentsSSLHelper(this)); | 106 ssl_helper_.reset(new TabContentsSSLHelper(this)); |
104 synced_tab_delegate_.reset(new TabContentsWrapperSyncedTabDelegate(this)); | 107 synced_tab_delegate_.reset(new TabContentsWrapperSyncedTabDelegate(this)); |
105 content_settings_.reset(new TabSpecificContentSettings(contents)); | 108 content_settings_.reset(new TabSpecificContentSettings(contents)); |
106 translate_tab_helper_.reset(new TranslateTabHelper(contents)); | 109 translate_tab_helper_.reset(new TranslateTabHelper(contents)); |
107 web_intent_picker_controller_.reset(new WebIntentPickerController( | 110 web_intent_picker_controller_.reset(new WebIntentPickerController( |
108 this, new WebIntentPickerFactoryImpl())); | 111 this, new WebIntentPickerFactoryImpl())); |
109 | 112 |
110 // Create the per-tab observers. | 113 // Create the per-tab observers. |
111 alternate_error_page_tab_observer_.reset( | 114 alternate_error_page_tab_observer_.reset( |
112 new AlternateErrorPageTabObserver(contents)); | 115 new AlternateErrorPageTabObserver(contents)); |
| 116 #if defined(ENABLE_INPUT_COLOR) |
| 117 color_select_observer_.reset(new ColorSelectObserver(contents)); |
| 118 #endif // defined(ENABLE_INPUT_COLOR) |
113 download_request_limiter_observer_.reset( | 119 download_request_limiter_observer_.reset( |
114 new DownloadRequestLimiterObserver(contents)); | 120 new DownloadRequestLimiterObserver(contents)); |
115 webnavigation_observer_.reset( | 121 webnavigation_observer_.reset( |
116 new ExtensionWebNavigationTabObserver(contents)); | 122 new ExtensionWebNavigationTabObserver(contents)); |
117 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); | 123 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); |
118 if (OmniboxSearchHint::IsEnabled(profile())) | 124 if (OmniboxSearchHint::IsEnabled(profile())) |
119 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); | 125 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); |
120 pdf_tab_observer_.reset(new PDFTabObserver(this)); | 126 pdf_tab_observer_.reset(new PDFTabObserver(this)); |
121 plugin_observer_.reset(new PluginObserver(this)); | 127 plugin_observer_.reset(new PluginObserver(this)); |
122 print_preview_.reset(new printing::PrintPreviewMessageHandler(contents)); | 128 print_preview_.reset(new printing::PrintPreviewMessageHandler(contents)); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 | 190 |
185 //////////////////////////////////////////////////////////////////////////////// | 191 //////////////////////////////////////////////////////////////////////////////// |
186 // WebContentsObserver overrides | 192 // WebContentsObserver overrides |
187 | 193 |
188 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { | 194 void TabContentsWrapper::WebContentsDestroyed(WebContents* tab) { |
189 // Destruction of the WebContents should only be done by us from our | 195 // Destruction of the WebContents should only be done by us from our |
190 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 196 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
191 // will attempt to access the TabContents and we'll crash. | 197 // will attempt to access the TabContents and we'll crash. |
192 DCHECK(in_destructor_); | 198 DCHECK(in_destructor_); |
193 } | 199 } |
OLD | NEW |