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

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

Issue 2911293003: Reland: Cache protected password entry and password on focus ping separately. (Closed)
Patch Set: Fix Crashes by Using GetDictionaryWithoutPathExpansion Created 3 years, 6 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 {CONTENT_SETTINGS_TYPE_APP_BANNER, 22}, 50 {CONTENT_SETTINGS_TYPE_APP_BANNER, 22},
51 {CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, 23}, 51 {CONTENT_SETTINGS_TYPE_SITE_ENGAGEMENT, 23},
52 {CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, 24}, 52 {CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, 24},
53 {CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD, 26}, 53 {CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD, 26},
54 {CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, 27}, 54 {CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, 27},
55 {CONTENT_SETTINGS_TYPE_AUTOPLAY, 28}, 55 {CONTENT_SETTINGS_TYPE_AUTOPLAY, 28},
56 {CONTENT_SETTINGS_TYPE_IMPORTANT_SITE_INFO, 30}, 56 {CONTENT_SETTINGS_TYPE_IMPORTANT_SITE_INFO, 30},
57 {CONTENT_SETTINGS_TYPE_PERMISSION_AUTOBLOCKER_DATA, 31}, 57 {CONTENT_SETTINGS_TYPE_PERMISSION_AUTOBLOCKER_DATA, 31},
58 {CONTENT_SETTINGS_TYPE_ADS, 32}, 58 {CONTENT_SETTINGS_TYPE_ADS, 32},
59 {CONTENT_SETTINGS_TYPE_ADS_DATA, 33}, 59 {CONTENT_SETTINGS_TYPE_ADS_DATA, 33},
60 {CONTENT_SETTINGS_TYPE_PASSWORD_PROTECTION, 34},
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 (const HistogramValue& histogram_value : kHistogramValue) 69 for (const HistogramValue& histogram_value : kHistogramValue)
69 kMap[histogram_value.type] = histogram_value.value; 70 kMap[histogram_value.type] = histogram_value.value;
(...skipping 19 matching lines...) Expand all
89 ContentSettingPatternSource::ContentSettingPatternSource() 90 ContentSettingPatternSource::ContentSettingPatternSource()
90 : setting(CONTENT_SETTING_DEFAULT), incognito(false) { 91 : setting(CONTENT_SETTING_DEFAULT), incognito(false) {
91 } 92 }
92 93
93 ContentSettingPatternSource::ContentSettingPatternSource( 94 ContentSettingPatternSource::ContentSettingPatternSource(
94 const ContentSettingPatternSource& other) = default; 95 const ContentSettingPatternSource& other) = default;
95 96
96 RendererContentSettingRules::RendererContentSettingRules() {} 97 RendererContentSettingRules::RendererContentSettingRules() {}
97 98
98 RendererContentSettingRules::~RendererContentSettingRules() {} 99 RendererContentSettingRules::~RendererContentSettingRules() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698