Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: chrome/browser/ui/tab_contents/tab_contents.cc

Issue 10938033: Switch BlockedContentTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 autofill_delegate_.reset(new TabAutofillManagerDelegate(this)); 118 autofill_delegate_.reset(new TabAutofillManagerDelegate(this));
119 autofill_manager_ = new AutofillManager(autofill_delegate_.get(), this); 119 autofill_manager_ = new AutofillManager(autofill_delegate_.get(), this);
120 if (CommandLine::ForCurrentProcess()->HasSwitch( 120 if (CommandLine::ForCurrentProcess()->HasSwitch(
121 switches::kExternalAutofillPopup)) { 121 switches::kExternalAutofillPopup)) {
122 autofill_external_delegate_.reset( 122 autofill_external_delegate_.reset(
123 AutofillExternalDelegate::Create(this, autofill_manager_.get())); 123 AutofillExternalDelegate::Create(this, autofill_manager_.get()));
124 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get()); 124 autofill_manager_->SetExternalDelegate(autofill_external_delegate_.get());
125 autocomplete_history_manager_->SetExternalDelegate( 125 autocomplete_history_manager_->SetExternalDelegate(
126 autofill_external_delegate_.get()); 126 autofill_external_delegate_.get());
127 } 127 }
128 blocked_content_tab_helper_.reset(new BlockedContentTabHelper(this)); 128 BlockedContentTabHelper::CreateForWebContents(contents);
129 BookmarkTabHelper::CreateForWebContents(contents); 129 BookmarkTabHelper::CreateForWebContents(contents);
130 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents(contents); 130 chrome_browser_net::LoadTimeStatsTabHelper::CreateForWebContents(contents);
131 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this)); 131 constrained_window_tab_helper_.reset(new ConstrainedWindowTabHelper(this));
132 content_settings_.reset(new TabSpecificContentSettings(contents)); 132 content_settings_.reset(new TabSpecificContentSettings(contents));
133 CoreTabHelper::CreateForWebContents(contents); 133 CoreTabHelper::CreateForWebContents(contents);
134 extensions::TabHelper::CreateForWebContents(contents); 134 extensions::TabHelper::CreateForWebContents(contents);
135 favicon_tab_helper_.reset(new FaviconTabHelper(contents)); 135 favicon_tab_helper_.reset(new FaviconTabHelper(contents));
136 find_tab_helper_.reset(new FindTabHelper(contents)); 136 find_tab_helper_.reset(new FindTabHelper(contents));
137 history_tab_helper_.reset(new HistoryTabHelper(contents)); 137 history_tab_helper_.reset(new HistoryTabHelper(contents));
138 hung_plugin_tab_helper_.reset(new HungPluginTabHelper(contents)); 138 hung_plugin_tab_helper_.reset(new HungPluginTabHelper(contents));
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 242
243 //////////////////////////////////////////////////////////////////////////////// 243 ////////////////////////////////////////////////////////////////////////////////
244 // WebContentsObserver overrides 244 // WebContentsObserver overrides
245 245
246 void TabContents::WebContentsDestroyed(WebContents* tab) { 246 void TabContents::WebContentsDestroyed(WebContents* tab) {
247 // Destruction of the WebContents should only be done by us from our 247 // Destruction of the WebContents should only be done by us from our
248 // destructor. Otherwise it's very likely we (or one of the helpers we own) 248 // destructor. Otherwise it's very likely we (or one of the helpers we own)
249 // will attempt to access the WebContents and we'll crash. 249 // will attempt to access the WebContents and we'll crash.
250 DCHECK(in_destructor_); 250 DCHECK(in_destructor_);
251 } 251 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tab_contents/tab_contents.h ('k') | chrome/browser/ui/views/external_tab_container_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698