| 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 "components/content_settings/core/common/content_settings.h" | 5 #include "components/content_settings/core/common/content_settings.h" |
| 6 | 6 |
| 7 #include "base/containers/hash_tables.h" | 7 #include "base/containers/hash_tables.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS, | 44 CONTENT_SETTINGS_TYPE_SSL_CERT_DECISIONS, |
| 45 CONTENT_SETTINGS_TYPE_DEFAULT, // METRO_SWITCH_TO_DESKTOP (deprecated). | 45 CONTENT_SETTINGS_TYPE_DEFAULT, // METRO_SWITCH_TO_DESKTOP (deprecated). |
| 46 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) | 46 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
| 47 CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, | 47 CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, |
| 48 #else | 48 #else |
| 49 CONTENT_SETTINGS_TYPE_DEFAULT, // PROTECTED_MEDIA_IDENTIFIER (mobile only). | 49 CONTENT_SETTINGS_TYPE_DEFAULT, // PROTECTED_MEDIA_IDENTIFIER (mobile only). |
| 50 #endif | 50 #endif |
| 51 CONTENT_SETTINGS_TYPE_APP_BANNER, | 51 CONTENT_SETTINGS_TYPE_APP_BANNER, |
| 52 CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, | 52 CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, |
| 53 CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, | 53 CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, |
| 54 CONTENT_SETTINGS_TYPE_USB, |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 int ContentSettingTypeToHistogramValue(ContentSettingsType content_setting, | 57 int ContentSettingTypeToHistogramValue(ContentSettingsType content_setting, |
| 57 size_t* num_values) { | 58 size_t* num_values) { |
| 58 // Translate the list above into a map for fast lookup. | 59 // Translate the list above into a map for fast lookup. |
| 59 typedef base::hash_map<int, int> Map; | 60 typedef base::hash_map<int, int> Map; |
| 60 CR_DEFINE_STATIC_LOCAL(Map, kMap, ()); | 61 CR_DEFINE_STATIC_LOCAL(Map, kMap, ()); |
| 61 if (kMap.empty()) { | 62 if (kMap.empty()) { |
| 62 for (size_t i = 0; i < arraysize(kHistogramOrder); ++i) { | 63 for (size_t i = 0; i < arraysize(kHistogramOrder); ++i) { |
| 63 if (kHistogramOrder[i] != CONTENT_SETTINGS_TYPE_DEFAULT) | 64 if (kHistogramOrder[i] != CONTENT_SETTINGS_TYPE_DEFAULT) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 82 source(source), | 83 source(source), |
| 83 incognito(incognito) {} | 84 incognito(incognito) {} |
| 84 | 85 |
| 85 ContentSettingPatternSource::ContentSettingPatternSource() | 86 ContentSettingPatternSource::ContentSettingPatternSource() |
| 86 : setting(CONTENT_SETTING_DEFAULT), incognito(false) { | 87 : setting(CONTENT_SETTING_DEFAULT), incognito(false) { |
| 87 } | 88 } |
| 88 | 89 |
| 89 RendererContentSettingRules::RendererContentSettingRules() {} | 90 RendererContentSettingRules::RendererContentSettingRules() {} |
| 90 | 91 |
| 91 RendererContentSettingRules::~RendererContentSettingRules() {} | 92 RendererContentSettingRules::~RendererContentSettingRules() {} |
| OLD | NEW |