Chromium Code Reviews| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 179 new safe_browsing::SafeBrowsingTabObserver(this)); | 179 new safe_browsing::SafeBrowsingTabObserver(this)); |
| 180 webnavigation_observer_.reset( | 180 webnavigation_observer_.reset( |
| 181 new extensions::WebNavigationTabObserver(contents)); | 181 new extensions::WebNavigationTabObserver(contents)); |
| 182 | 182 |
| 183 #if !defined(OS_ANDROID) | 183 #if !defined(OS_ANDROID) |
| 184 if (OmniboxSearchHint::IsEnabled(profile())) | 184 if (OmniboxSearchHint::IsEnabled(profile())) |
| 185 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); | 185 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); |
| 186 #endif | 186 #endif |
| 187 | 187 |
| 188 #if defined(ENABLE_PRINTING) | 188 #if defined(ENABLE_PRINTING) |
| 189 print_view_manager_.reset(new printing::PrintViewManager(this)); | 189 printing::PrintPreviewMessageHandler::CreateForWebContents(contents); |
| 190 print_preview_.reset(new printing::PrintPreviewMessageHandler(contents)); | 190 printing::PrintViewManager::CreateForWebContents(contents); |
|
Scott Byer
2012/09/18 17:24:40
Did you intend to reverse the creation order? (Not
| |
| 191 #endif | 191 #endif |
| 192 | 192 |
| 193 // Start the in-browser thumbnailing if the feature is enabled. | 193 // Start the in-browser thumbnailing if the feature is enabled. |
| 194 if (ShouldEnableInBrowserThumbnailing()) { | 194 if (ShouldEnableInBrowserThumbnailing()) { |
| 195 thumbnail_generator_.reset(new ThumbnailGenerator); | 195 thumbnail_generator_.reset(new ThumbnailGenerator); |
| 196 thumbnail_generator_->StartThumbnailing(web_contents_.get()); | 196 thumbnail_generator_->StartThumbnailing(web_contents_.get()); |
| 197 } | 197 } |
| 198 | 198 |
| 199 // If this is not an incognito window, setup to handle one-click login. | 199 // If this is not an incognito window, setup to handle one-click login. |
| 200 // We don't want to check that the profile is already connected at this time | 200 // 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... | |
| 251 | 251 |
| 252 //////////////////////////////////////////////////////////////////////////////// | 252 //////////////////////////////////////////////////////////////////////////////// |
| 253 // WebContentsObserver overrides | 253 // WebContentsObserver overrides |
| 254 | 254 |
| 255 void TabContents::WebContentsDestroyed(WebContents* tab) { | 255 void TabContents::WebContentsDestroyed(WebContents* tab) { |
| 256 // Destruction of the WebContents should only be done by us from our | 256 // Destruction of the WebContents should only be done by us from our |
| 257 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 257 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
| 258 // will attempt to access the WebContents and we'll crash. | 258 // will attempt to access the WebContents and we'll crash. |
| 259 DCHECK(in_destructor_); | 259 DCHECK(in_destructor_); |
| 260 } | 260 } |
| OLD | NEW |