| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); | 175 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); |
| 176 navigation_metrics_recorder_.reset(new NavigationMetricsRecorder(contents)); | 176 navigation_metrics_recorder_.reset(new NavigationMetricsRecorder(contents)); |
| 177 pepper_broker_observer_.reset(new PepperBrokerObserver(contents)); | 177 pepper_broker_observer_.reset(new PepperBrokerObserver(contents)); |
| 178 plugin_observer_.reset(new PluginObserver(this)); | 178 plugin_observer_.reset(new PluginObserver(this)); |
| 179 safe_browsing_tab_observer_.reset( | 179 safe_browsing_tab_observer_.reset( |
| 180 new safe_browsing::SafeBrowsingTabObserver(this)); | 180 new safe_browsing::SafeBrowsingTabObserver(this)); |
| 181 webnavigation_observer_.reset( | 181 webnavigation_observer_.reset( |
| 182 new extensions::WebNavigationTabObserver(contents)); | 182 new extensions::WebNavigationTabObserver(contents)); |
| 183 | 183 |
| 184 #if defined(ENABLE_PRINTING) | 184 #if defined(ENABLE_PRINTING) |
| 185 print_view_manager_.reset(new printing::PrintViewManager(this)); | 185 printing::PrintPreviewMessageHandler::CreateForWebContents(contents); |
| 186 print_preview_.reset(new printing::PrintPreviewMessageHandler(contents)); | 186 printing::PrintViewManager::CreateForWebContents(contents); |
| 187 #endif | 187 #endif |
| 188 | 188 |
| 189 // Start the in-browser thumbnailing if the feature is enabled. | 189 // Start the in-browser thumbnailing if the feature is enabled. |
| 190 if (ShouldEnableInBrowserThumbnailing()) { | 190 if (ShouldEnableInBrowserThumbnailing()) { |
| 191 thumbnail_generator_.reset(new ThumbnailGenerator); | 191 thumbnail_generator_.reset(new ThumbnailGenerator); |
| 192 thumbnail_generator_->StartThumbnailing(web_contents_.get()); | 192 thumbnail_generator_->StartThumbnailing(web_contents_.get()); |
| 193 } | 193 } |
| 194 | 194 |
| 195 // If this is not an incognito window, setup to handle one-click login. | 195 // If this is not an incognito window, setup to handle one-click login. |
| 196 // We don't want to check that the profile is already connected at this time | 196 // We don't want to check that the profile is already connected at this time |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 //////////////////////////////////////////////////////////////////////////////// | 248 //////////////////////////////////////////////////////////////////////////////// |
| 249 // WebContentsObserver overrides | 249 // WebContentsObserver overrides |
| 250 | 250 |
| 251 void TabContents::WebContentsDestroyed(WebContents* tab) { | 251 void TabContents::WebContentsDestroyed(WebContents* tab) { |
| 252 // Destruction of the WebContents should only be done by us from our | 252 // Destruction of the WebContents should only be done by us from our |
| 253 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 253 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
| 254 // will attempt to access the WebContents and we'll crash. | 254 // will attempt to access the WebContents and we'll crash. |
| 255 DCHECK(in_destructor_); | 255 DCHECK(in_destructor_); |
| 256 } | 256 } |
| OLD | NEW |