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

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

Issue 7464009: Removal of Profile from content part 1. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: browser_context Created 9 years, 5 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) 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/ui/content_settings/content_setting_image_model.h" 5 #include "chrome/browser/ui/content_settings/content_setting_image_model.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/content_settings/host_content_settings_map.h" 8 #include "chrome/browser/content_settings/host_content_settings_map.h"
9 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 9 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
10 #include "chrome/browser/prerender/prerender_manager.h" 10 #include "chrome/browser/prerender/prerender_manager.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 TabContents* tab_contents) { 104 TabContents* tab_contents) {
105 set_visible(false); 105 set_visible(false);
106 if (!tab_contents) 106 if (!tab_contents)
107 return; 107 return;
108 108
109 const int* icon_ids = kBlockedIconIDs; 109 const int* icon_ids = kBlockedIconIDs;
110 const int* tooltip_ids = kBlockedTooltipIDs; 110 const int* tooltip_ids = kBlockedTooltipIDs;
111 const int* explanatory_string_ids = kBlockedExplanatoryTextIDs; 111 const int* explanatory_string_ids = kBlockedExplanatoryTextIDs;
112 // If a content type is blocked by default and was accessed, display the 112 // If a content type is blocked by default and was accessed, display the
113 // accessed icon. 113 // accessed icon.
114 TabSpecificContentSettings* content_settings = 114 TabContentsWrapper* wrapper =
115 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents)-> 115 TabContentsWrapper::GetCurrentWrapperForContents(tab_contents);
116 content_settings(); 116 TabSpecificContentSettings* content_settings = wrapper->content_settings();
117 if (!content_settings->IsContentBlocked(get_content_settings_type())) { 117 if (!content_settings->IsContentBlocked(get_content_settings_type())) {
118 if (!content_settings->IsContentAccessed(get_content_settings_type()) || 118 if (!content_settings->IsContentAccessed(get_content_settings_type()) ||
119 (tab_contents->profile()->GetHostContentSettingsMap()-> 119 (wrapper->profile()->GetHostContentSettingsMap()->
120 GetDefaultContentSetting(get_content_settings_type()) != 120 GetDefaultContentSetting(get_content_settings_type()) !=
121 CONTENT_SETTING_BLOCK)) 121 CONTENT_SETTING_BLOCK))
122 return; 122 return;
123 icon_ids = kAccessedIconIDs; 123 icon_ids = kAccessedIconIDs;
124 tooltip_ids = kAccessedTooltipIDs; 124 tooltip_ids = kAccessedTooltipIDs;
125 explanatory_string_ids = kAccessedExplanatoryTextIDs; 125 explanatory_string_ids = kAccessedExplanatoryTextIDs;
126 } 126 }
127 set_visible(true); 127 set_visible(true);
128 set_icon(icon_ids[get_content_settings_type()]); 128 set_icon(icon_ids[get_content_settings_type()]);
129 set_explanatory_string_id( 129 set_explanatory_string_id(
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 ContentSettingsType content_settings_type) { 186 ContentSettingsType content_settings_type) {
187 switch (content_settings_type) { 187 switch (content_settings_type) {
188 case CONTENT_SETTINGS_TYPE_GEOLOCATION: 188 case CONTENT_SETTINGS_TYPE_GEOLOCATION:
189 return new ContentSettingGeolocationImageModel(); 189 return new ContentSettingGeolocationImageModel();
190 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: 190 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
191 return new ContentSettingNotificationsImageModel(); 191 return new ContentSettingNotificationsImageModel();
192 default: 192 default:
193 return new ContentSettingBlockedImageModel(content_settings_type); 193 return new ContentSettingBlockedImageModel(content_settings_type);
194 } 194 }
195 } 195 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698