| 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/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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 ContentSettings output = GetNonDefaultContentSettings(url); | 289 ContentSettings output = GetNonDefaultContentSettings(url); |
| 290 | 290 |
| 291 // If we require a resource identifier, set the content settings to default, | 291 // If we require a resource identifier, set the content settings to default, |
| 292 // otherwise make the defaults explicit. | 292 // otherwise make the defaults explicit. |
| 293 for (int j = 0; j < CONTENT_SETTINGS_NUM_TYPES; ++j) { | 293 for (int j = 0; j < CONTENT_SETTINGS_NUM_TYPES; ++j) { |
| 294 if (RequiresResourceIdentifier(ContentSettingsType(j))) { | 294 if (RequiresResourceIdentifier(ContentSettingsType(j))) { |
| 295 output.settings[j] = CONTENT_SETTING_DEFAULT; | 295 output.settings[j] = CONTENT_SETTING_DEFAULT; |
| 296 } else { | 296 } else { |
| 297 // A managed default content setting has the highest priority and hence | 297 // A managed default content setting has the highest priority and hence |
| 298 // will overwrite any previously set value. | 298 // will overwrite any previously set value. |
| 299 if ((output.settings[j] == CONTENT_SETTING_DEFAULT) || | 299 if ((output.settings[j] == CONTENT_SETTING_DEFAULT && |
| 300 j != CONTENT_SETTINGS_TYPE_PLUGINS) || |
| 300 IsDefaultContentSettingManaged(ContentSettingsType(j))) { | 301 IsDefaultContentSettingManaged(ContentSettingsType(j))) { |
| 301 output.settings[j] = GetDefaultContentSetting(ContentSettingsType(j)); | 302 output.settings[j] = GetDefaultContentSetting(ContentSettingsType(j)); |
| 302 } | 303 } |
| 303 } | 304 } |
| 304 } | 305 } |
| 305 return output; | 306 return output; |
| 306 } | 307 } |
| 307 | 308 |
| 308 ContentSettings HostContentSettingsMap::GetNonDefaultContentSettings( | 309 ContentSettings HostContentSettingsMap::GetNonDefaultContentSettings( |
| 309 const GURL& url) const { | 310 const GURL& url) const { |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 } | 975 } |
| 975 | 976 |
| 976 for (size_t i = 0; i < move_items.size(); ++i) { | 977 for (size_t i = 0; i < move_items.size(); ++i) { |
| 977 Value* pattern_settings_dictionary = NULL; | 978 Value* pattern_settings_dictionary = NULL; |
| 978 all_settings_dictionary->RemoveWithoutPathExpansion( | 979 all_settings_dictionary->RemoveWithoutPathExpansion( |
| 979 move_items[i].first, &pattern_settings_dictionary); | 980 move_items[i].first, &pattern_settings_dictionary); |
| 980 all_settings_dictionary->SetWithoutPathExpansion( | 981 all_settings_dictionary->SetWithoutPathExpansion( |
| 981 move_items[i].second, pattern_settings_dictionary); | 982 move_items[i].second, pattern_settings_dictionary); |
| 982 } | 983 } |
| 983 } | 984 } |
| OLD | NEW |