Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: components/content_settings/core/common/content_settings.cc

Issue 2680283002: Adds the setting to limitl the subresource filter activation. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_DEFAULT, // KEYGEN (removed). 55 CONTENT_SETTINGS_TYPE_DEFAULT, // KEYGEN (removed).
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_DEFAULT, // PROMPT_NO_DECISION_COUNT (migrated). 59 CONTENT_SETTINGS_TYPE_DEFAULT, // PROMPT_NO_DECISION_COUNT (migrated).
60 CONTENT_SETTINGS_TYPE_IMPORTANT_SITE_INFO, 60 CONTENT_SETTINGS_TYPE_IMPORTANT_SITE_INFO,
61 CONTENT_SETTINGS_TYPE_PERMISSION_AUTOBLOCKER_DATA}; 61 CONTENT_SETTINGS_TYPE_PERMISSION_AUTOBLOCKER_DATA,
62 CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER,
63 };
62 64
63 int ContentSettingTypeToHistogramValue(ContentSettingsType content_setting, 65 int ContentSettingTypeToHistogramValue(ContentSettingsType content_setting,
64 size_t* num_values) { 66 size_t* num_values) {
65 // Translate the list above into a map for fast lookup. 67 // Translate the list above into a map for fast lookup.
66 typedef base::hash_map<int, int> Map; 68 typedef base::hash_map<int, int> Map;
67 CR_DEFINE_STATIC_LOCAL(Map, kMap, ()); 69 CR_DEFINE_STATIC_LOCAL(Map, kMap, ());
68 if (kMap.empty()) { 70 if (kMap.empty()) {
69 for (size_t i = 0; i < arraysize(kHistogramOrder); ++i) { 71 for (size_t i = 0; i < arraysize(kHistogramOrder); ++i) {
70 if (kHistogramOrder[i] != CONTENT_SETTINGS_TYPE_DEFAULT) 72 if (kHistogramOrder[i] != CONTENT_SETTINGS_TYPE_DEFAULT)
71 kMap[kHistogramOrder[i]] = static_cast<int>(i); 73 kMap[kHistogramOrder[i]] = static_cast<int>(i);
(...skipping 20 matching lines...) Expand all
92 ContentSettingPatternSource::ContentSettingPatternSource() 94 ContentSettingPatternSource::ContentSettingPatternSource()
93 : setting(CONTENT_SETTING_DEFAULT), incognito(false) { 95 : setting(CONTENT_SETTING_DEFAULT), incognito(false) {
94 } 96 }
95 97
96 ContentSettingPatternSource::ContentSettingPatternSource( 98 ContentSettingPatternSource::ContentSettingPatternSource(
97 const ContentSettingPatternSource& other) = default; 99 const ContentSettingPatternSource& other) = default;
98 100
99 RendererContentSettingRules::RendererContentSettingRules() {} 101 RendererContentSettingRules::RendererContentSettingRules() {}
100 102
101 RendererContentSettingRules::~RendererContentSettingRules() {} 103 RendererContentSettingRules::~RendererContentSettingRules() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698