OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_settings/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 if (prefs->HasPrefPath(prefs::kCookieBehavior)) { | 877 if (prefs->HasPrefPath(prefs::kCookieBehavior)) { |
878 int cookie_behavior = prefs->GetInteger(prefs::kCookieBehavior); | 878 int cookie_behavior = prefs->GetInteger(prefs::kCookieBehavior); |
879 prefs->ClearPref(prefs::kCookieBehavior); | 879 prefs->ClearPref(prefs::kCookieBehavior); |
880 if (!prefs->HasPrefPath(prefs::kDefaultContentSettings)) { | 880 if (!prefs->HasPrefPath(prefs::kDefaultContentSettings)) { |
881 SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, | 881 SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_COOKIES, |
882 (cookie_behavior == net::StaticCookiePolicy::BLOCK_ALL_COOKIES) ? | 882 (cookie_behavior == net::StaticCookiePolicy::BLOCK_ALL_COOKIES) ? |
883 CONTENT_SETTING_BLOCK : CONTENT_SETTING_ALLOW); | 883 CONTENT_SETTING_BLOCK : CONTENT_SETTING_ALLOW); |
884 } | 884 } |
885 if (!prefs->HasPrefPath(prefs::kBlockThirdPartyCookies)) { | 885 if (!prefs->HasPrefPath(prefs::kBlockThirdPartyCookies)) { |
886 SetBlockThirdPartyCookies(cookie_behavior == | 886 SetBlockThirdPartyCookies(cookie_behavior == |
887 net::StaticCookiePolicy::BLOCK_THIRD_PARTY_COOKIES); | 887 net::StaticCookiePolicy::BLOCK_SETTING_THIRD_PARTY_COOKIES); |
888 } | 888 } |
889 } | 889 } |
890 } | 890 } |
891 | 891 |
892 void HostContentSettingsMap::MigrateObsoletePopupsPref(PrefService* prefs) { | 892 void HostContentSettingsMap::MigrateObsoletePopupsPref(PrefService* prefs) { |
893 if (prefs->HasPrefPath(prefs::kPopupWhitelistedHosts)) { | 893 if (prefs->HasPrefPath(prefs::kPopupWhitelistedHosts)) { |
894 const ListValue* whitelist_pref = | 894 const ListValue* whitelist_pref = |
895 prefs->GetList(prefs::kPopupWhitelistedHosts); | 895 prefs->GetList(prefs::kPopupWhitelistedHosts); |
896 for (ListValue::const_iterator i(whitelist_pref->begin()); | 896 for (ListValue::const_iterator i(whitelist_pref->begin()); |
897 i != whitelist_pref->end(); ++i) { | 897 i != whitelist_pref->end(); ++i) { |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 } | 968 } |
969 | 969 |
970 for (size_t i = 0; i < move_items.size(); ++i) { | 970 for (size_t i = 0; i < move_items.size(); ++i) { |
971 Value* pattern_settings_dictionary = NULL; | 971 Value* pattern_settings_dictionary = NULL; |
972 all_settings_dictionary->RemoveWithoutPathExpansion( | 972 all_settings_dictionary->RemoveWithoutPathExpansion( |
973 move_items[i].first, &pattern_settings_dictionary); | 973 move_items[i].first, &pattern_settings_dictionary); |
974 all_settings_dictionary->SetWithoutPathExpansion( | 974 all_settings_dictionary->SetWithoutPathExpansion( |
975 move_items[i].second, pattern_settings_dictionary); | 975 move_items[i].second, pattern_settings_dictionary); |
976 } | 976 } |
977 } | 977 } |
OLD | NEW |