OLD | NEW |
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/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/content_settings/content_settings_utils.h" | 9 #include "chrome/browser/content_settings/content_settings_utils.h" |
10 #include "chrome/browser/content_settings/cookie_settings.h" | 10 #include "chrome/browser/content_settings/cookie_settings.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 } else { | 345 } else { |
346 radio_block_label = l10n_util::GetStringUTF8( | 346 radio_block_label = l10n_util::GetStringUTF8( |
347 GetIdForContentType(kBlockedBlockIDs, arraysize(kBlockedBlockIDs), | 347 GetIdForContentType(kBlockedBlockIDs, arraysize(kBlockedBlockIDs), |
348 content_type())); | 348 content_type())); |
349 } | 349 } |
350 | 350 |
351 radio_group.radio_items.push_back(radio_allow_label); | 351 radio_group.radio_items.push_back(radio_allow_label); |
352 radio_group.radio_items.push_back(radio_block_label); | 352 radio_group.radio_items.push_back(radio_block_label); |
353 HostContentSettingsMap* map = profile()->GetHostContentSettingsMap(); | 353 HostContentSettingsMap* map = profile()->GetHostContentSettingsMap(); |
354 CookieSettings* cookie_settings = | 354 CookieSettings* cookie_settings = |
355 CookieSettings::Factory::GetForProfile(profile()); | 355 CookieSettings::Factory::GetForProfile(profile()).get(); |
356 ContentSetting most_restrictive_setting; | 356 ContentSetting most_restrictive_setting; |
357 SettingSource most_restrictive_setting_source = SETTING_SOURCE_NONE; | 357 SettingSource most_restrictive_setting_source = SETTING_SOURCE_NONE; |
358 | 358 |
359 if (resources.empty()) { | 359 if (resources.empty()) { |
360 if (content_type() == CONTENT_SETTINGS_TYPE_COOKIES) { | 360 if (content_type() == CONTENT_SETTINGS_TYPE_COOKIES) { |
361 most_restrictive_setting = cookie_settings->GetCookieSetting( | 361 most_restrictive_setting = cookie_settings->GetCookieSetting( |
362 url, url, true, &most_restrictive_setting_source); | 362 url, url, true, &most_restrictive_setting_source); |
363 } else { | 363 } else { |
364 SettingInfo info; | 364 SettingInfo info; |
365 scoped_ptr<Value> value(map->GetWebsiteSetting( | 365 scoped_ptr<Value> value(map->GetWebsiteSetting( |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 1117 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
1118 DCHECK_EQ(web_contents_, | 1118 DCHECK_EQ(web_contents_, |
1119 content::Source<WebContents>(source).ptr()); | 1119 content::Source<WebContents>(source).ptr()); |
1120 web_contents_ = NULL; | 1120 web_contents_ = NULL; |
1121 } else { | 1121 } else { |
1122 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); | 1122 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); |
1123 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); | 1123 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); |
1124 profile_ = NULL; | 1124 profile_ = NULL; |
1125 } | 1125 } |
1126 } | 1126 } |
OLD | NEW |