| 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/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" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 webnavigation_observer_.reset( | 135 webnavigation_observer_.reset( |
| 136 new extensions::WebNavigationTabObserver(contents)); | 136 new extensions::WebNavigationTabObserver(contents)); |
| 137 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); | 137 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); |
| 138 pdf_tab_observer_.reset(new PDFTabObserver(this)); | 138 pdf_tab_observer_.reset(new PDFTabObserver(this)); |
| 139 safe_browsing_tab_observer_.reset( | 139 safe_browsing_tab_observer_.reset( |
| 140 new safe_browsing::SafeBrowsingTabObserver(this)); | 140 new safe_browsing::SafeBrowsingTabObserver(this)); |
| 141 | 141 |
| 142 #if defined(OS_WIN) | 142 #if defined(OS_WIN) |
| 143 // Metro mode Chrome on Windows does not support plugins. Avoid registering | 143 // Metro mode Chrome on Windows does not support plugins. Avoid registering |
| 144 // the PluginObserver so we don't popup plugin-related infobars. | 144 // the PluginObserver so we don't popup plugin-related infobars. |
| 145 if (!base::win::GetMetroModule()) | 145 if (!base::win::IsMetroProcess()) |
| 146 plugin_observer_.reset(new PluginObserver(this)); | 146 plugin_observer_.reset(new PluginObserver(this)); |
| 147 #else | 147 #else |
| 148 plugin_observer_.reset(new PluginObserver(this)); | 148 plugin_observer_.reset(new PluginObserver(this)); |
| 149 #endif | 149 #endif |
| 150 | 150 |
| 151 #if !defined(OS_ANDROID) | 151 #if !defined(OS_ANDROID) |
| 152 if (OmniboxSearchHint::IsEnabled(profile())) | 152 if (OmniboxSearchHint::IsEnabled(profile())) |
| 153 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); | 153 omnibox_search_hint_.reset(new OmniboxSearchHint(this)); |
| 154 #endif | 154 #endif |
| 155 | 155 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 239 |
| 240 //////////////////////////////////////////////////////////////////////////////// | 240 //////////////////////////////////////////////////////////////////////////////// |
| 241 // WebContentsObserver overrides | 241 // WebContentsObserver overrides |
| 242 | 242 |
| 243 void TabContents::WebContentsDestroyed(WebContents* tab) { | 243 void TabContents::WebContentsDestroyed(WebContents* tab) { |
| 244 // Destruction of the WebContents should only be done by us from our | 244 // Destruction of the WebContents should only be done by us from our |
| 245 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 245 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
| 246 // will attempt to access the WebContents and we'll crash. | 246 // will attempt to access the WebContents and we'll crash. |
| 247 DCHECK(in_destructor_); | 247 DCHECK(in_destructor_); |
| 248 } | 248 } |
| OLD | NEW |