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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 121 if (CommandLine::ForCurrentProcess()->HasSwitch( | 121 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 122 switches::kExternalAutofillPopup)) { | 122 switches::kExternalAutofillPopup)) { |
| 123 autofill_external_delegate_.reset( | 123 autofill_external_delegate_.reset( |
| 124 AutofillExternalDelegate::Create(this, autofill_manager_.get())); | 124 AutofillExternalDelegate::Create(this, autofill_manager_.get())); |
| 125 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); | 125 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); |
| 126 autocomplete_history_manager_->SetExternalDelegate( | 126 autocomplete_history_manager_->SetExternalDelegate( |
| 127 autofill_external_delegate_.get()); | 127 autofill_external_delegate_.get()); |
| 128 } | 128 } |
| 129 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); | 129 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); |
| 130 bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); | 130 bookmark_tab_helper_.reset(new BookmarkTabHelper(this)); |
| 131 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents(contents); | |
|
cbentzel
2012/09/18 13:55:41
Should this be created at the same location as bef
Avi (use Gerrit)
2012/09/18 14:11:47
If there's a dependency in the creation of TabHelp
| |
| 131 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); | 132 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); |
| 132 content_settings_.reset(new TabSpecificContentSettings(contents)); | 133 content_settings_.reset(new TabSpecificContentSettings(contents)); |
| 133 core_tab_helper_.reset(new CoreTabHelper(contents)); | 134 core_tab_helper_.reset(new CoreTabHelper(contents)); |
| 134 extensions::TabHelper::CreateForWebContents(contents); | 135 extensions::TabHelper::CreateForWebContents(contents); |
| 135 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); | 136 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); |
| 136 find_tab_helper_.reset(new FindTabHelper(contents)); | 137 find_tab_helper_.reset(new FindTabHelper(contents)); |
| 137 history_tab_helper_.reset(new HistoryTabHelper(contents)); | 138 history_tab_helper_.reset(new HistoryTabHelper(contents)); |
| 138 hung_plugin_tab_helper_.reset(new HungPluginTabHelper(contents)); | 139 hung_plugin_tab_helper_.reset(new HungPluginTabHelper(contents)); |
| 139 infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); | 140 infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); |
| 140 load_time_stats_tab_helper_.reset( | |
| 141 new chrome_browser_net::LoadTimeStatsTabHelper(this)); | |
| 142 MetroPinTabHelper::CreateForWebContents(contents); | 141 MetroPinTabHelper::CreateForWebContents(contents); |
| 143 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(this)); | 142 password_manager_delegate_.reset(new PasswordManagerDelegateImpl(this)); |
| 144 password_manager_.reset( | 143 password_manager_.reset( |
| 145 new PasswordManager(contents, password_manager_delegate_.get())); | 144 new PasswordManager(contents, password_manager_delegate_.get())); |
| 146 prefs_tab_helper_.reset(new PrefsTabHelper(contents)); | 145 prefs_tab_helper_.reset(new PrefsTabHelper(contents)); |
| 147 prerender_tab_helper_.reset(new prerender::PrerenderTabHelper(this)); | 146 prerender_tab_helper_.reset(new prerender::PrerenderTabHelper(this)); |
| 148 search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); | 147 search_engine_tab_helper_.reset(new SearchEngineTabHelper(contents)); |
| 149 bool is_search_enabled = | 148 bool is_search_enabled = |
| 150 chrome::search::IsInstantExtendedAPIEnabled(profile()); | 149 chrome::search::IsInstantExtendedAPIEnabled(profile()); |
| 151 search_tab_helper_.reset( | 150 search_tab_helper_.reset( |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 251 | 250 |
| 252 //////////////////////////////////////////////////////////////////////////////// | 251 //////////////////////////////////////////////////////////////////////////////// |
| 253 // WebContentsObserver overrides | 252 // WebContentsObserver overrides |
| 254 | 253 |
| 255 void TabContents::WebContentsDestroyed(WebContents* tab) { | 254 void TabContents::WebContentsDestroyed(WebContents* tab) { |
| 256 // Destruction of the WebContents should only be done by us from our | 255 // 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) | 256 // 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. | 257 // will attempt to access the WebContents and we'll crash. |
| 259 DCHECK(in_destructor_); | 258 DCHECK(in_destructor_); |
| 260 } | 259 } |
| OLD | NEW |