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