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 "components/content_settings/core/browser/host_content_settings_map.h" | 5 #include "components/content_settings/core/browser/host_content_settings_map.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 } else if (type == CONTENT_SETTINGS_TYPE_COOKIES || | 338 } else if (type == CONTENT_SETTINGS_TYPE_COOKIES || |
339 type == CONTENT_SETTINGS_TYPE_IMAGES || | 339 type == CONTENT_SETTINGS_TYPE_IMAGES || |
340 type == CONTENT_SETTINGS_TYPE_JAVASCRIPT || | 340 type == CONTENT_SETTINGS_TYPE_JAVASCRIPT || |
341 type == CONTENT_SETTINGS_TYPE_PLUGINS || | 341 type == CONTENT_SETTINGS_TYPE_PLUGINS || |
342 type == CONTENT_SETTINGS_TYPE_POPUPS || | 342 type == CONTENT_SETTINGS_TYPE_POPUPS || |
343 type == CONTENT_SETTINGS_TYPE_MOUSELOCK || | 343 type == CONTENT_SETTINGS_TYPE_MOUSELOCK || |
344 type == CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS || | 344 type == CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS || |
345 type == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING) { | 345 type == CONTENT_SETTINGS_TYPE_PUSH_MESSAGING) { |
346 primary_pattern = ContentSettingsPattern::FromURL(primary_url); | 346 primary_pattern = ContentSettingsPattern::FromURL(primary_url); |
347 secondary_pattern = ContentSettingsPattern::Wildcard(); | 347 secondary_pattern = ContentSettingsPattern::Wildcard(); |
348 } else if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || | 348 } else if (type == CONTENT_SETTINGS_TYPE_KEYGEN || |
| 349 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || |
349 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA || | 350 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA || |
350 type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS || | 351 type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS || |
351 type == CONTENT_SETTINGS_TYPE_PPAPI_BROKER) { | 352 type == CONTENT_SETTINGS_TYPE_PPAPI_BROKER) { |
352 primary_pattern = ContentSettingsPattern::FromURLNoWildcard(primary_url); | 353 primary_pattern = ContentSettingsPattern::FromURLNoWildcard(primary_url); |
353 secondary_pattern = ContentSettingsPattern::Wildcard(); | 354 secondary_pattern = ContentSettingsPattern::Wildcard(); |
354 } else { | 355 } else { |
355 NOTREACHED() << "ContentSettingsType " << type << "is not supported."; | 356 NOTREACHED() << "ContentSettingsType " << type << "is not supported."; |
356 } | 357 } |
357 | 358 |
358 // Permission settings are specified via rules. There exists always at least | 359 // Permission settings are specified via rules. There exists always at least |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 rule.secondary_pattern.Matches(secondary_url)) { | 745 rule.secondary_pattern.Matches(secondary_url)) { |
745 if (primary_pattern) | 746 if (primary_pattern) |
746 *primary_pattern = rule.primary_pattern; | 747 *primary_pattern = rule.primary_pattern; |
747 if (secondary_pattern) | 748 if (secondary_pattern) |
748 *secondary_pattern = rule.secondary_pattern; | 749 *secondary_pattern = rule.secondary_pattern; |
749 return make_scoped_ptr(rule.value.get()->DeepCopy()); | 750 return make_scoped_ptr(rule.value.get()->DeepCopy()); |
750 } | 751 } |
751 } | 752 } |
752 return scoped_ptr<base::Value>(); | 753 return scoped_ptr<base::Value>(); |
753 } | 754 } |
OLD | NEW |