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 "chrome/browser/content_settings/host_content_settings_map.h" | 5 #include "chrome/browser/content_settings/host_content_settings_map.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: | 397 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: |
398 return setting == CONTENT_SETTING_ASK; | 398 return setting == CONTENT_SETTING_ASK; |
399 default: | 399 default: |
400 return false; | 400 return false; |
401 } | 401 } |
402 } | 402 } |
403 | 403 |
404 // static | 404 // static |
405 bool HostContentSettingsMap::ContentTypeHasCompoundValue( | 405 bool HostContentSettingsMap::ContentTypeHasCompoundValue( |
406 ContentSettingsType type) { | 406 ContentSettingsType type) { |
407 // Values for content type CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE and | 407 // Values for content type CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE, |
408 // CONTENT_SETTINGS_TYPE_MEDIASTREAM are of type dictionary/map. Compound | 408 // CONTENT_SETTINGS_TYPE_MEDIASTREAM, and |
409 // types like dictionaries can't be mapped to the type |ContentSetting|. | 409 // CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS are of type dictionary/map. |
| 410 // Compound types like dictionaries can't be mapped to the type |
| 411 // |ContentSetting|. |
410 #if defined(OS_ANDROID) | 412 #if defined(OS_ANDROID) |
411 if (type == CONTENT_SETTINGS_TYPE_APP_BANNER) | 413 if (type == CONTENT_SETTINGS_TYPE_APP_BANNER) |
412 return true; | 414 return true; |
413 #endif | 415 #endif |
414 | 416 |
415 return (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE || | 417 return (type == CONTENT_SETTINGS_TYPE_AUTO_SELECT_CERTIFICATE || |
416 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM); | 418 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM || |
| 419 type == CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS); |
417 } | 420 } |
418 | 421 |
419 void HostContentSettingsMap::OnContentSettingChanged( | 422 void HostContentSettingsMap::OnContentSettingChanged( |
420 const ContentSettingsPattern& primary_pattern, | 423 const ContentSettingsPattern& primary_pattern, |
421 const ContentSettingsPattern& secondary_pattern, | 424 const ContentSettingsPattern& secondary_pattern, |
422 ContentSettingsType content_type, | 425 ContentSettingsType content_type, |
423 std::string resource_identifier) { | 426 std::string resource_identifier) { |
424 const ContentSettingsDetails details(primary_pattern, | 427 const ContentSettingsDetails details(primary_pattern, |
425 secondary_pattern, | 428 secondary_pattern, |
426 content_type, | 429 content_type, |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 HostContentSettingsMap::GetProviderTypeFromSource( | 634 HostContentSettingsMap::GetProviderTypeFromSource( |
632 const std::string& source) { | 635 const std::string& source) { |
633 for (size_t i = 0; i < arraysize(kProviderNames); ++i) { | 636 for (size_t i = 0; i < arraysize(kProviderNames); ++i) { |
634 if (source == kProviderNames[i]) | 637 if (source == kProviderNames[i]) |
635 return static_cast<ProviderType>(i); | 638 return static_cast<ProviderType>(i); |
636 } | 639 } |
637 | 640 |
638 NOTREACHED(); | 641 NOTREACHED(); |
639 return DEFAULT_PROVIDER; | 642 return DEFAULT_PROVIDER; |
640 } | 643 } |
OLD | NEW |