| 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 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/browser/omnibox_search_hint.h" | 21 #include "chrome/browser/omnibox_search_hint.h" |
| 22 #include "chrome/browser/password_manager/password_manager.h" | 22 #include "chrome/browser/password_manager/password_manager.h" |
| 23 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" | 23 #include "chrome/browser/password_manager/password_manager_delegate_impl.h" |
| 24 #include "chrome/browser/pepper_broker_observer.h" | 24 #include "chrome/browser/pepper_broker_observer.h" |
| 25 #include "chrome/browser/plugin_observer.h" | 25 #include "chrome/browser/plugin_observer.h" |
| 26 #include "chrome/browser/prerender/prerender_tab_helper.h" | 26 #include "chrome/browser/prerender/prerender_tab_helper.h" |
| 27 #include "chrome/browser/printing/print_preview_message_handler.h" | 27 #include "chrome/browser/printing/print_preview_message_handler.h" |
| 28 #include "chrome/browser/printing/print_view_manager.h" | 28 #include "chrome/browser/printing/print_view_manager.h" |
| 29 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" | 29 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" |
| 30 #include "chrome/browser/sessions/session_tab_helper.h" | 30 #include "chrome/browser/sessions/session_tab_helper.h" |
| 31 #include "chrome/browser/ssl/ssl_tab_helper.h" |
| 31 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" | 32 #include "chrome/browser/tab_contents/navigation_metrics_recorder.h" |
| 32 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" | |
| 33 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 33 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
| 34 #include "chrome/browser/translate/translate_tab_helper.h" | 34 #include "chrome/browser/translate/translate_tab_helper.h" |
| 35 #include "chrome/browser/ui/alternate_error_tab_observer.h" | 35 #include "chrome/browser/ui/alternate_error_tab_observer.h" |
| 36 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" | 36 #include "chrome/browser/ui/autofill/tab_autofill_manager_delegate.h" |
| 37 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" | 37 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" |
| 38 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" | 38 #include "chrome/browser/ui/bookmarks/bookmark_tab_helper.h" |
| 39 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 39 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
| 40 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 40 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 41 #include "chrome/browser/ui/hung_plugin_tab_helper.h" | 41 #include "chrome/browser/ui/hung_plugin_tab_helper.h" |
| 42 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" | 42 #include "chrome/browser/ui/intents/web_intent_picker_controller.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 password_manager_.reset( | 144 password_manager_.reset( |
| 145 new PasswordManager(contents, password_manager_delegate_.get())); | 145 new PasswordManager(contents, password_manager_delegate_.get())); |
| 146 prefs_tab_helper_.reset(new PrefsTabHelper(contents)); | 146 prefs_tab_helper_.reset(new PrefsTabHelper(contents)); |
| 147 prerender_tab_helper_.reset(new prerender::PrerenderTabHelper(this)); | 147 prerender_tab_helper_.reset(new prerender::PrerenderTabHelper(this)); |
| 148 search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); | 148 search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); |
| 149 bool is_search_enabled = | 149 bool is_search_enabled = |
| 150 chrome::search::IsInstantExtendedAPIEnabled(profile()); | 150 chrome::search::IsInstantExtendedAPIEnabled(profile()); |
| 151 search_tab_helper_.reset( | 151 search_tab_helper_.reset( |
| 152 new chrome::search::SearchTabHelper(this, is_search_enabled)); | 152 new chrome::search::SearchTabHelper(this, is_search_enabled)); |
| 153 SnapshotTabHelper::CreateForWebContents(contents); | 153 SnapshotTabHelper::CreateForWebContents(contents); |
| 154 ssl_helper_.reset(new TabContentsSSLHelper(this)); | 154 SSLTabHelper::CreateForWebContents(contents); |
| 155 synced_tab_delegate_.reset(new TabContentsSyncedTabDelegate(this)); | 155 synced_tab_delegate_.reset(new TabContentsSyncedTabDelegate(this)); |
| 156 translate_tab_helper_.reset(new TranslateTabHelper(contents)); | 156 translate_tab_helper_.reset(new TranslateTabHelper(contents)); |
| 157 zoom_controller_.reset(new ZoomController(this)); | 157 zoom_controller_.reset(new ZoomController(this)); |
| 158 | 158 |
| 159 #if defined(ENABLE_AUTOMATION) | 159 #if defined(ENABLE_AUTOMATION) |
| 160 automation_tab_helper_.reset(new AutomationTabHelper(contents)); | 160 automation_tab_helper_.reset(new AutomationTabHelper(contents)); |
| 161 #endif | 161 #endif |
| 162 | 162 |
| 163 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 163 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 164 captive_portal_tab_helper_.reset( | 164 captive_portal_tab_helper_.reset( |
| (...skipping 86 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 |