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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); | 117 search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); |
118 bool is_search_enabled = | 118 bool is_search_enabled = |
119 chrome::search::IsInstantExtendedAPIEnabled(profile()); | 119 chrome::search::IsInstantExtendedAPIEnabled(profile()); |
120 search_tab_helper_.reset( | 120 search_tab_helper_.reset( |
121 new chrome::search::SearchTabHelper(this, is_search_enabled)); | 121 new chrome::search::SearchTabHelper(this, is_search_enabled)); |
122 snapshot_tab_helper_.reset(new SnapshotTabHelper(contents)); | 122 snapshot_tab_helper_.reset(new SnapshotTabHelper(contents)); |
123 ssl_helper_.reset(new TabContentsSSLHelper(this)); | 123 ssl_helper_.reset(new TabContentsSSLHelper(this)); |
124 synced_tab_delegate_.reset(new TabContentsSyncedTabDelegate(this)); | 124 synced_tab_delegate_.reset(new TabContentsSyncedTabDelegate(this)); |
125 content_settings_.reset(new TabSpecificContentSettings(contents)); | 125 content_settings_.reset(new TabSpecificContentSettings(contents)); |
126 translate_tab_helper_.reset(new TranslateTabHelper(contents)); | 126 translate_tab_helper_.reset(new TranslateTabHelper(contents)); |
127 web_intent_picker_controller_.reset(new WebIntentPickerController(this)); | |
128 zoom_controller_.reset(new ZoomController(this)); | 127 zoom_controller_.reset(new ZoomController(this)); |
129 | 128 |
130 #if !defined(OS_ANDROID) | 129 #if !defined(OS_ANDROID) |
| 130 web_intent_picker_controller_.reset(new WebIntentPickerController(this)); |
131 sad_tab_helper_.reset(new SadTabHelper(contents)); | 131 sad_tab_helper_.reset(new SadTabHelper(contents)); |
132 #endif | 132 #endif |
133 | 133 |
134 // Create the per-tab observers. | 134 // Create the per-tab observers. |
135 alternate_error_page_tab_observer_.reset( | 135 alternate_error_page_tab_observer_.reset( |
136 new AlternateErrorPageTabObserver(contents, profile())); | 136 new AlternateErrorPageTabObserver(contents, profile())); |
137 webnavigation_observer_.reset( | 137 webnavigation_observer_.reset( |
138 new extensions::WebNavigationTabObserver(contents)); | 138 new extensions::WebNavigationTabObserver(contents)); |
139 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); | 139 external_protocol_observer_.reset(new ExternalProtocolObserver(contents)); |
140 pdf_tab_observer_.reset(new PDFTabObserver(this)); | 140 pdf_tab_observer_.reset(new PDFTabObserver(this)); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 234 |
235 //////////////////////////////////////////////////////////////////////////////// | 235 //////////////////////////////////////////////////////////////////////////////// |
236 // WebContentsObserver overrides | 236 // WebContentsObserver overrides |
237 | 237 |
238 void TabContents::WebContentsDestroyed(WebContents* tab) { | 238 void TabContents::WebContentsDestroyed(WebContents* tab) { |
239 // Destruction of the WebContents should only be done by us from our | 239 // Destruction of the WebContents should only be done by us from our |
240 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 240 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
241 // will attempt to access the WebContents and we'll crash. | 241 // will attempt to access the WebContents and we'll crash. |
242 DCHECK(in_destructor_); | 242 DCHECK(in_destructor_); |
243 } | 243 } |
OLD | NEW |