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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 CONTENT_SETTINGS_TYPE_DEFAULT, // PROTECTED_MEDIA_IDENTIFIER (mobile only). | 50 CONTENT_SETTINGS_TYPE_DEFAULT, // PROTECTED_MEDIA_IDENTIFIER (mobile only). |
51 #endif | 51 #endif |
52 CONTENT_SETTINGS_TYPE_APP_BANNER, | 52 CONTENT_SETTINGS_TYPE_APP_BANNER, |
53 CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, | 53 CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, |
54 CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, | 54 CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, |
55 CONTENT_SETTINGS_TYPE_KEYGEN, | 55 CONTENT_SETTINGS_TYPE_KEYGEN, |
56 CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD, | 56 CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD, |
57 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, | 57 CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, |
58 CONTENT_SETTINGS_TYPE_AUTOPLAY, | 58 CONTENT_SETTINGS_TYPE_AUTOPLAY, |
59 CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT, | 59 CONTENT_SETTINGS_TYPE_PROMPT_NO_DECISION_COUNT, |
| 60 CONTENT_SETTINGS_TYPE_MEDIASTREAM_SCREEN, |
60 }; | 61 }; |
61 | 62 |
62 int ContentSettingTypeToHistogramValue(ContentSettingsType content_setting, | 63 int ContentSettingTypeToHistogramValue(ContentSettingsType content_setting, |
63 size_t* num_values) { | 64 size_t* num_values) { |
64 // Translate the list above into a map for fast lookup. | 65 // Translate the list above into a map for fast lookup. |
65 typedef base::hash_map<int, int> Map; | 66 typedef base::hash_map<int, int> Map; |
66 CR_DEFINE_STATIC_LOCAL(Map, kMap, ()); | 67 CR_DEFINE_STATIC_LOCAL(Map, kMap, ()); |
67 if (kMap.empty()) { | 68 if (kMap.empty()) { |
68 for (size_t i = 0; i < arraysize(kHistogramOrder); ++i) { | 69 for (size_t i = 0; i < arraysize(kHistogramOrder); ++i) { |
69 if (kHistogramOrder[i] != CONTENT_SETTINGS_TYPE_DEFAULT) | 70 if (kHistogramOrder[i] != CONTENT_SETTINGS_TYPE_DEFAULT) |
(...skipping 21 matching lines...) Expand all Loading... |
91 ContentSettingPatternSource::ContentSettingPatternSource() | 92 ContentSettingPatternSource::ContentSettingPatternSource() |
92 : setting(CONTENT_SETTING_DEFAULT), incognito(false) { | 93 : setting(CONTENT_SETTING_DEFAULT), incognito(false) { |
93 } | 94 } |
94 | 95 |
95 ContentSettingPatternSource::ContentSettingPatternSource( | 96 ContentSettingPatternSource::ContentSettingPatternSource( |
96 const ContentSettingPatternSource& other) = default; | 97 const ContentSettingPatternSource& other) = default; |
97 | 98 |
98 RendererContentSettingRules::RendererContentSettingRules() {} | 99 RendererContentSettingRules::RendererContentSettingRules() {} |
99 | 100 |
100 RendererContentSettingRules::~RendererContentSettingRules() {} | 101 RendererContentSettingRules::~RendererContentSettingRules() {} |
OLD | NEW |