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

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

Issue 6814029: Revert 80519 - Move favicon from TabContents to TabContentsWrapper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 8 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
Property Changes:
Added: svn:mergeinfo
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/content_setting_bubble_model.h" 5 #include "chrome/browser/content_setting_bubble_model.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/blocked_content_container.h" 9 #include "chrome/browser/blocked_content_container.h"
10 #include "chrome/browser/content_settings/host_content_settings_map.h" 10 #include "chrome/browser/content_settings/host_content_settings_map.h"
11 #include "chrome/browser/favicon_tab_helper.h"
12 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" 11 #include "chrome/browser/geolocation/geolocation_content_settings_map.h"
13 #include "chrome/browser/metrics/user_metrics.h" 12 #include "chrome/browser/metrics/user_metrics.h"
14 #include "chrome/browser/prefs/pref_service.h" 13 #include "chrome/browser/prefs/pref_service.h"
15 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/tab_contents/tab_specific_content_settings.h" 15 #include "chrome/browser/tab_contents/tab_specific_content_settings.h"
17 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" 16 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h"
18 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
19 #include "chrome/common/pref_names.h" 17 #include "chrome/common/pref_names.h"
20 #include "content/browser/renderer_host/render_view_host.h" 18 #include "content/browser/renderer_host/render_view_host.h"
21 #include "content/browser/tab_contents/tab_contents.h" 19 #include "content/browser/tab_contents/tab_contents.h"
22 #include "content/browser/tab_contents/tab_contents_delegate.h" 20 #include "content/browser/tab_contents/tab_contents_delegate.h"
23 #include "content/common/notification_service.h" 21 #include "content/common/notification_service.h"
24 #include "grit/generated_resources.h" 22 #include "grit/generated_resources.h"
25 #include "net/base/net_util.h" 23 #include "net/base/net_util.h"
26 #include "ui/base/l10n/l10n_util.h" 24 #include "ui/base/l10n/l10n_util.h"
27 25
28 class ContentSettingTitleAndLinkModel : public ContentSettingBubbleModel { 26 class ContentSettingTitleAndLinkModel : public ContentSettingBubbleModel {
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 private: 377 private:
380 void SetPopups() { 378 void SetPopups() {
381 // check for crbug.com/53176 379 // check for crbug.com/53176
382 if (!tab_contents()->blocked_content_container()) 380 if (!tab_contents()->blocked_content_container())
383 return; 381 return;
384 std::vector<TabContents*> blocked_contents; 382 std::vector<TabContents*> blocked_contents;
385 tab_contents()->blocked_content_container()->GetBlockedContents( 383 tab_contents()->blocked_content_container()->GetBlockedContents(
386 &blocked_contents); 384 &blocked_contents);
387 for (std::vector<TabContents*>::const_iterator 385 for (std::vector<TabContents*>::const_iterator
388 i(blocked_contents.begin()); i != blocked_contents.end(); ++i) { 386 i(blocked_contents.begin()); i != blocked_contents.end(); ++i) {
389 // TODO(avi): move blocked contents from TC to TCW; remove this.
390 TabContentsWrapper* wrapper =
391 TabContentsWrapper::GetCurrentWrapperForContents(*i);
392 std::string title(UTF16ToUTF8((*i)->GetTitle())); 387 std::string title(UTF16ToUTF8((*i)->GetTitle()));
393 // The popup may not have committed a load yet, in which case it won't 388 // The popup may not have committed a load yet, in which case it won't
394 // have a URL or title. 389 // have a URL or title.
395 if (title.empty()) 390 if (title.empty())
396 title = l10n_util::GetStringUTF8(IDS_TAB_LOADING_TITLE); 391 title = l10n_util::GetStringUTF8(IDS_TAB_LOADING_TITLE);
397 PopupItem popup_item; 392 PopupItem popup_item;
398 popup_item.title = title; 393 popup_item.title = title;
399 popup_item.bitmap = wrapper->favicon_tab_helper()->GetFavicon(); 394 popup_item.bitmap = (*i)->GetFavicon();
400 popup_item.tab_contents = (*i); 395 popup_item.tab_contents = (*i);
401 add_popup(popup_item); 396 add_popup(popup_item);
402 } 397 }
403 } 398 }
404 399
405 virtual void OnPopupClicked(int index) { 400 virtual void OnPopupClicked(int index) {
406 if (tab_contents() && tab_contents()->blocked_content_container()) { 401 if (tab_contents() && tab_contents()->blocked_content_container()) {
407 tab_contents()->blocked_content_container()->LaunchForContents( 402 tab_contents()->blocked_content_container()->LaunchForContents(
408 bubble_content().popup_items[index].tab_contents); 403 bubble_content().popup_items[index].tab_contents);
409 } 404 }
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 bubble_content_.resource_identifiers.insert(resource_identifier); 534 bubble_content_.resource_identifiers.insert(resource_identifier);
540 } 535 }
541 536
542 void ContentSettingBubbleModel::Observe(NotificationType type, 537 void ContentSettingBubbleModel::Observe(NotificationType type,
543 const NotificationSource& source, 538 const NotificationSource& source,
544 const NotificationDetails& details) { 539 const NotificationDetails& details) {
545 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); 540 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED);
546 DCHECK(source == Source<TabContents>(tab_contents_)); 541 DCHECK(source == Source<TabContents>(tab_contents_));
547 tab_contents_ = NULL; 542 tab_contents_ = NULL;
548 } 543 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/wm_overview_controller.cc ('k') | chrome/browser/extensions/extension_tabs_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698