| 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/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" |
| 11 #include "chrome/browser/metrics/user_metrics.h" | 11 #include "chrome/browser/metrics/user_metrics.h" |
| 12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
| 13 #include "chrome/browser/profile.h" | 13 #include "chrome/browser/profile.h" |
| 14 #include "chrome/browser/prefs/scoped_pref_update.h" | 14 #include "chrome/browser/prefs/scoped_pref_update.h" |
| 15 #include "chrome/common/notification_service.h" | 15 #include "chrome/common/notification_service.h" |
| (...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 if (default_settings_dictionary != NULL) { | 980 if (default_settings_dictionary != NULL) { |
| 981 GetSettingsFromDictionary(default_settings_dictionary, | 981 GetSettingsFromDictionary(default_settings_dictionary, |
| 982 &default_content_settings_); | 982 &default_content_settings_); |
| 983 } | 983 } |
| 984 ForceDefaultsToBeExplicit(); | 984 ForceDefaultsToBeExplicit(); |
| 985 | 985 |
| 986 // Read managed default content settings. | 986 // Read managed default content settings. |
| 987 ReadManagedDefaultSettings(prefs, &managed_default_content_settings_); | 987 ReadManagedDefaultSettings(prefs, &managed_default_content_settings_); |
| 988 } | 988 } |
| 989 | 989 |
| 990 void HostContentSettingsMap::ReadManagedDefaultSettings ( | 990 void HostContentSettingsMap::ReadManagedDefaultSettings( |
| 991 const PrefService* prefs, ContentSettings* settings) { | 991 const PrefService* prefs, ContentSettings* settings) { |
| 992 for (size_t type = 0; type < arraysize(kPrefToManageType); ++type) { | 992 for (size_t type = 0; type < arraysize(kPrefToManageType); ++type) { |
| 993 if (kPrefToManageType[type] == NULL) { | 993 if (kPrefToManageType[type] == NULL) { |
| 994 // TODO(markusheintz): Handle Geolocation and notification separately. | 994 // TODO(markusheintz): Handle Geolocation and notification separately. |
| 995 continue; | 995 continue; |
| 996 } | 996 } |
| 997 UpdateManagedDefaultSetting(ContentSettingsType(type), prefs, settings); | 997 UpdateManagedDefaultSetting(ContentSettingsType(type), prefs, settings); |
| 998 } | 998 } |
| 999 } | 999 } |
| 1000 | 1000 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 } | 1167 } |
| 1168 | 1168 |
| 1169 for (size_t i = 0; i < move_items.size(); ++i) { | 1169 for (size_t i = 0; i < move_items.size(); ++i) { |
| 1170 Value* pattern_settings_dictionary = NULL; | 1170 Value* pattern_settings_dictionary = NULL; |
| 1171 all_settings_dictionary->RemoveWithoutPathExpansion( | 1171 all_settings_dictionary->RemoveWithoutPathExpansion( |
| 1172 move_items[i].first, &pattern_settings_dictionary); | 1172 move_items[i].first, &pattern_settings_dictionary); |
| 1173 all_settings_dictionary->SetWithoutPathExpansion( | 1173 all_settings_dictionary->SetWithoutPathExpansion( |
| 1174 move_items[i].second, pattern_settings_dictionary); | 1174 move_items[i].second, pattern_settings_dictionary); |
| 1175 } | 1175 } |
| 1176 } | 1176 } |
| OLD | NEW |