| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 autofill_manager_ = new AutofillManager(autofill_delegate_.get(), this); | 120 autofill_manager_ = new AutofillManager(autofill_delegate_.get(), this); |
| 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 BookmarkTabHelper::CreateForWebContents(contents); |
| 131 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents(contents); | 131 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents(contents); |
| 132 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); | 132 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); |
| 133 content_settings_.reset(new TabSpecificContentSettings(contents)); | 133 content_settings_.reset(new TabSpecificContentSettings(contents)); |
| 134 core_tab_helper_.reset(new CoreTabHelper(contents)); | 134 core_tab_helper_.reset(new CoreTabHelper(contents)); |
| 135 extensions::TabHelper::CreateForWebContents(contents); | 135 extensions::TabHelper::CreateForWebContents(contents); |
| 136 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); | 136 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); |
| 137 find_tab_helper_.reset(new FindTabHelper(contents)); | 137 find_tab_helper_.reset(new FindTabHelper(contents)); |
| 138 history_tab_helper_.reset(new HistoryTabHelper(contents)); | 138 history_tab_helper_.reset(new HistoryTabHelper(contents)); |
| 139 hung_plugin_tab_helper_.reset(new HungPluginTabHelper(contents)); | 139 hung_plugin_tab_helper_.reset(new HungPluginTabHelper(contents)); |
| 140 infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); | 140 infobar_tab_helper_.reset(new InfoBarTabHelper(contents)); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 //////////////////////////////////////////////////////////////////////////////// | 248 //////////////////////////////////////////////////////////////////////////////// |
| 249 // WebContentsObserver overrides | 249 // WebContentsObserver overrides |
| 250 | 250 |
| 251 void TabContents::WebContentsDestroyed(WebContents* tab) { | 251 void TabContents::WebContentsDestroyed(WebContents* tab) { |
| 252 // Destruction of the WebContents should only be done by us from our | 252 // Destruction of the WebContents should only be done by us from our |
| 253 // destructor. Otherwise it's very likely we (or one of the helpers we own) | 253 // destructor. Otherwise it's very likely we (or one of the helpers we own) |
| 254 // will attempt to access the WebContents and we'll crash. | 254 // will attempt to access the WebContents and we'll crash. |
| 255 DCHECK(in_destructor_); | 255 DCHECK(in_destructor_); |
| 256 } | 256 } |
| OLD | NEW |