| 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/autofill/autocomplete_history_manager.h" | 9 #include "chrome/browser/autofill/autocomplete_history_manager.h" |
| 10 #include "chrome/browser/autofill/autofill_external_delegate.h" | 10 #include "chrome/browser/autofill/autofill_external_delegate.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 autocomplete_history_manager_->SetExternalDelegate( | 125 autocomplete_history_manager_->SetExternalDelegate( |
| 126 autofill_external_delegate_.get()); | 126 autofill_external_delegate_.get()); |
| 127 } | 127 } |
| 128 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); | 128 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); |
| 129 BookmarkTabHelper::CreateForWebContents(contents); | 129 BookmarkTabHelper::CreateForWebContents(contents); |
| 130 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents(contents); | 130 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents(contents); |
| 131 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); | 131 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); |
| 132 content_settings_.reset(new TabSpecificContentSettings(contents)); | 132 content_settings_.reset(new TabSpecificContentSettings(contents)); |
| 133 CoreTabHelper::CreateForWebContents(contents); | 133 CoreTabHelper::CreateForWebContents(contents); |
| 134 extensions::TabHelper::CreateForWebContents(contents); | 134 extensions::TabHelper::CreateForWebContents(contents); |
| 135 extensions::WebNavigationTabObserver::CreateForWebContents(contents); |
| 135 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); | 136 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); |
| 136 find_tab_helper_.reset(new FindTabHelper(contents)); | 137 find_tab_helper_.reset(new FindTabHelper(contents)); |
| 137 history_tab_helper_.reset(new HistoryTabHelper(contents)); | 138 history_tab_helper_.reset(new HistoryTabHelper(contents)); |
| 138 hung_plugin_tab_helper_.reset(new HungPluginTabHelper(contents)); | 139 hung_plugin_tab_helper_.reset(new HungPluginTabHelper(contents)); |
| 139 infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); | 140 infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); |
| 140 MetroPinTabHelper::CreateForWebContents(contents); | 141 MetroPinTabHelper::CreateForWebContents(contents); |
| 141 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(this)); | 142 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(this)); |
| 142 password_manager_.reset( | 143 password_manager_.reset( |
| 143 new PasswordManager(contents, password_manager_delegate_.get())); | 144 new PasswordManager(contents, password_manager_delegate_.get())); |
| 144 prefs_tab_helper_.reset(new PrefsTabHelper(contents)); | 145 prefs_tab_helper_.reset(new PrefsTabHelper(contents)); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 166 SadTabHelper::CreateForWebContents(contents); | 167 SadTabHelper::CreateForWebContents(contents); |
| 167 web_intent_picker_controller_.reset(new WebIntentPickerController(this)); | 168 web_intent_picker_controller_.reset(new WebIntentPickerController(this)); |
| 168 #endif | 169 #endif |
| 169 | 170 |
| 170 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); | 171 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); |
| 171 navigation_metrics_recorder_.reset(new NavigationMetricsRecorder(contents)); | 172 navigation_metrics_recorder_.reset(new NavigationMetricsRecorder(contents)); |
| 172 pepper_broker_observer_.reset(new PepperBrokerObserver(contents)); | 173 pepper_broker_observer_.reset(new PepperBrokerObserver(contents)); |
| 173 plugin_observer_.reset(new PluginObserver(this)); | 174 plugin_observer_.reset(new PluginObserver(this)); |
| 174 safe_browsing_tab_observer_.reset( | 175 safe_browsing_tab_observer_.reset( |
| 175 new safe_browsing::SafeBrowsingTabObserver(this)); | 176 new safe_browsing::SafeBrowsingTabObserver(this)); |
| 176 webnavigation_observer_.reset( | |
| 177 new extensions::WebNavigationTabObserver(contents)); | |
| 178 | 177 |
| 179 #if defined(ENABLE_PRINTING) | 178 #if defined(ENABLE_PRINTING) |
| 180 printing::PrintPreviewMessageHandler::CreateForWebContents(contents); | 179 printing::PrintPreviewMessageHandler::CreateForWebContents(contents); |
| 181 printing::PrintViewManager::CreateForWebContents(contents); | 180 printing::PrintViewManager::CreateForWebContents(contents); |
| 182 #endif | 181 #endif |
| 183 | 182 |
| 184 // Start the in-browser thumbnailing if the feature is enabled. | 183 // Start the in-browser thumbnailing if the feature is enabled. |
| 185 if (ShouldEnableInBrowserThumbnailing()) { | 184 if (ShouldEnableInBrowserThumbnailing()) { |
| 186 thumbnail_generator_.reset(new ThumbnailGenerator); | 185 thumbnail_generator_.reset(new ThumbnailGenerator); |
| 187 thumbnail_generator_->StartThumbnailing(web_contents_.get()); | 186 thumbnail_generator_->StartThumbnailing(web_contents_.get()); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 | 241 |
| 243 //////////////////////////////////////////////////////////////////////////////// | 242 //////////////////////////////////////////////////////////////////////////////// |
| 244 // WebContentsObserver overrides | 243 // WebContentsObserver overrides |
| 245 | 244 |
| 246 void TabContents::WebContentsDestroyed(WebContents* tab) { | 245 void TabContents::WebContentsDestroyed(WebContents* tab) { |
| 247 // Destruction of the WebContents should only be done by us from our | 246 // Destruction of the WebContents should only be done by us from our |
| 248 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 247 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
| 249 // will attempt to access the WebContents and we'll crash. | 248 // will attempt to access the WebContents and we'll crash. |
| 250 DCHECK(in_destructor_); | 249 DCHECK(in_destructor_); |
| 251 } | 250 } |
| OLD | NEW |