OLD | NEW |
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_bubble_model.h" | 5 #include "chrome/browser/ui/content_settings/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/content_settings/host_content_settings_map.h" | 9 #include "chrome/browser/content_settings/host_content_settings_map.h" |
10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 Need_a_setting_for_every_content_settings_type); | 273 Need_a_setting_for_every_content_settings_type); |
274 std::string radio_block_label; | 274 std::string radio_block_label; |
275 radio_block_label = l10n_util::GetStringUTF8(kBlockIDs[content_type()]); | 275 radio_block_label = l10n_util::GetStringUTF8(kBlockIDs[content_type()]); |
276 | 276 |
277 radio_group.radio_items.push_back(radio_allow_label); | 277 radio_group.radio_items.push_back(radio_allow_label); |
278 radio_group.radio_items.push_back(radio_block_label); | 278 radio_group.radio_items.push_back(radio_block_label); |
279 HostContentSettingsMap* map = profile()->GetHostContentSettingsMap(); | 279 HostContentSettingsMap* map = profile()->GetHostContentSettingsMap(); |
280 ContentSetting mostRestrictiveSetting; | 280 ContentSetting mostRestrictiveSetting; |
281 if (resources.empty()) { | 281 if (resources.empty()) { |
282 mostRestrictiveSetting = | 282 mostRestrictiveSetting = |
283 map->GetContentSetting(url, content_type(), std::string()); | 283 content_type() == CONTENT_SETTINGS_TYPE_COOKIES ? |
| 284 map->GetCookieContentSetting(url, url, true) : |
| 285 map->GetContentSetting(url, content_type(), std::string()); |
284 } else { | 286 } else { |
285 mostRestrictiveSetting = CONTENT_SETTING_ALLOW; | 287 mostRestrictiveSetting = CONTENT_SETTING_ALLOW; |
286 for (std::set<std::string>::const_iterator it = resources.begin(); | 288 for (std::set<std::string>::const_iterator it = resources.begin(); |
287 it != resources.end(); ++it) { | 289 it != resources.end(); ++it) { |
288 ContentSetting setting = map->GetContentSetting(url, | 290 ContentSetting setting = map->GetContentSetting(url, |
289 content_type(), | 291 content_type(), |
290 *it); | 292 *it); |
291 if (setting == CONTENT_SETTING_BLOCK) { | 293 if (setting == CONTENT_SETTING_BLOCK) { |
292 mostRestrictiveSetting = CONTENT_SETTING_BLOCK; | 294 mostRestrictiveSetting = CONTENT_SETTING_BLOCK; |
293 break; | 295 break; |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 bubble_content_.resource_identifiers.insert(resource_identifier); | 551 bubble_content_.resource_identifiers.insert(resource_identifier); |
550 } | 552 } |
551 | 553 |
552 void ContentSettingBubbleModel::Observe(NotificationType type, | 554 void ContentSettingBubbleModel::Observe(NotificationType type, |
553 const NotificationSource& source, | 555 const NotificationSource& source, |
554 const NotificationDetails& details) { | 556 const NotificationDetails& details) { |
555 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); | 557 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); |
556 DCHECK(source == Source<TabContents>(tab_contents_->tab_contents())); | 558 DCHECK(source == Source<TabContents>(tab_contents_->tab_contents())); |
557 tab_contents_ = NULL; | 559 tab_contents_ = NULL; |
558 } | 560 } |
OLD | NEW |