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

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 11011002: Switch FaviconTabHelper to use WebContentsUserData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 8 years, 2 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/content_settings/content_setting_bubble_model.h" 5 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/content_settings/content_settings_utils.h" 8 #include "chrome/browser/content_settings/content_settings_utils.h"
9 #include "chrome/browser/content_settings/cookie_settings.h" 9 #include "chrome/browser/content_settings/cookie_settings.h"
10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 for (std::vector<content::WebContents*>::const_iterator 470 for (std::vector<content::WebContents*>::const_iterator
471 i = blocked_contents.begin(); i != blocked_contents.end(); ++i) { 471 i = blocked_contents.begin(); i != blocked_contents.end(); ++i) {
472 std::string title(UTF16ToUTF8((*i)->GetTitle())); 472 std::string title(UTF16ToUTF8((*i)->GetTitle()));
473 // The popup may not have committed a load yet, in which case it won't 473 // The popup may not have committed a load yet, in which case it won't
474 // have a URL or title. 474 // have a URL or title.
475 if (title.empty()) 475 if (title.empty())
476 title = l10n_util::GetStringUTF8(IDS_TAB_LOADING_TITLE); 476 title = l10n_util::GetStringUTF8(IDS_TAB_LOADING_TITLE);
477 PopupItem popup_item; 477 PopupItem popup_item;
478 popup_item.title = title; 478 popup_item.title = title;
479 // TODO: Make this use gfx::Image. 479 // TODO: Make this use gfx::Image.
480 TabContents* tab_contents = TabContents::FromWebContents(*i);
481 popup_item.bitmap = 480 popup_item.bitmap =
482 tab_contents->favicon_tab_helper()->GetFavicon().AsBitmap(); 481 FaviconTabHelper::FromWebContents(*i)->GetFavicon().AsBitmap();
483 popup_item.tab_contents = tab_contents; 482 popup_item.tab_contents = TabContents::FromWebContents(*i);
484 add_popup(popup_item); 483 add_popup(popup_item);
485 } 484 }
486 } 485 }
487 486
488 void ContentSettingPopupBubbleModel::OnPopupClicked(int index) { 487 void ContentSettingPopupBubbleModel::OnPopupClicked(int index) {
489 if (tab_contents()) { 488 if (tab_contents()) {
490 BlockedContentTabHelper::FromWebContents(tab_contents()->web_contents())-> 489 BlockedContentTabHelper::FromWebContents(tab_contents()->web_contents())->
491 LaunchForContents( 490 LaunchForContents(
492 bubble_content().popup_items[index].tab_contents->web_contents()); 491 bubble_content().popup_items[index].tab_contents->web_contents());
493 } 492 }
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
828 const content::NotificationDetails& details) { 827 const content::NotificationDetails& details) {
829 if (type == chrome::NOTIFICATION_TAB_CONTENTS_DESTROYED) { 828 if (type == chrome::NOTIFICATION_TAB_CONTENTS_DESTROYED) {
830 DCHECK_EQ(tab_contents_, content::Source<TabContents>(source).ptr()); 829 DCHECK_EQ(tab_contents_, content::Source<TabContents>(source).ptr());
831 tab_contents_ = NULL; 830 tab_contents_ = NULL;
832 } else { 831 } else {
833 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); 832 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type);
834 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); 833 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr());
835 profile_ = NULL; 834 profile_ = NULL;
836 } 835 }
837 } 836 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm ('k') | chrome/browser/ui/gtk/hung_renderer_dialog_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698