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

Unified Diff: chrome/browser/ui/browser_tabstrip.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/browser_tabstrip.cc
diff --git a/chrome/browser/ui/browser_tabstrip.cc b/chrome/browser/ui/browser_tabstrip.cc
index e6168de9f182a904378d61a139accc21a1b73acb..e8200509bd007d3cf2af0c3717c1e02f9d4ae042 100644
--- a/chrome/browser/ui/browser_tabstrip.cc
+++ b/chrome/browser/ui/browser_tabstrip.cc
@@ -106,23 +106,24 @@ void AddWebContents(Browser* browser,
// Can't create a new contents for the current tab - invalid case.
DCHECK(disposition != CURRENT_TAB);
- TabContents* source_tab_contents = NULL;
- BlockedContentTabHelper* source_blocked_content = NULL;
+ // TODO(avi): Use browser tab contents adoption here.
TabContents* new_tab_contents = TabContents::FromWebContents(new_contents);
if (!new_tab_contents) {
new_tab_contents =
BrowserTabstripTabContentsCreator::CreateTabContents(new_contents);
}
+
+ BlockedContentTabHelper* source_blocked_content = NULL;
if (source_contents) {
- source_tab_contents = TabContents::FromWebContents(source_contents);
- source_blocked_content = source_tab_contents->blocked_content_tab_helper();
+ source_blocked_content =
+ BlockedContentTabHelper::FromWebContents(source_contents);
}
- if (source_tab_contents) {
+ if (source_contents) {
// Handle blocking of tabs.
if (source_blocked_content->all_contents_blocked()) {
- source_blocked_content->AddTabContents(
- new_tab_contents, disposition, initial_pos, user_gesture);
+ source_blocked_content->AddWebContents(
+ new_contents, disposition, initial_pos, user_gesture);
if (was_blocked)
*was_blocked = true;
return;
@@ -136,7 +137,7 @@ void AddWebContents(Browser* browser,
// Unrequested popups from normal pages are constrained unless they're in
// the white list. The popup owner will handle checking this.
source_blocked_content->AddPopup(
- new_tab_contents, disposition, initial_pos, user_gesture);
+ new_contents, disposition, initial_pos, user_gesture);
if (was_blocked)
*was_blocked = true;
return;
« no previous file with comments | « chrome/browser/ui/browser_adoption.cc ('k') | chrome/browser/ui/content_settings/content_setting_bubble_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698