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

Side by Side Diff: components/content_settings/core/browser/content_settings_registry.cc

Issue 1382783002: Store USB device permissions in website settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Convert WebUSBPermissionStore to a PermissionContext. Created 5 years, 2 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/content_settings_registry.h" 5 #include "components/content_settings/core/browser/content_settings_registry.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "components/content_settings/core/browser/content_settings_utils.h" 10 #include "components/content_settings/core/browser/content_settings_utils.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 CONTENT_SETTING_ASK, WebsiteSettingsInfo::SYNCABLE, 149 CONTENT_SETTING_ASK, WebsiteSettingsInfo::SYNCABLE,
150 NoWhitelistedSchemes()); 150 NoWhitelistedSchemes());
151 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) 151 #if defined(OS_ANDROID) || defined(OS_CHROMEOS)
152 Register(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, 152 Register(CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER,
153 "protected-media-identifier", CONTENT_SETTING_ASK, 153 "protected-media-identifier", CONTENT_SETTING_ASK,
154 WebsiteSettingsInfo::UNSYNCABLE, NoWhitelistedSchemes()); 154 WebsiteSettingsInfo::UNSYNCABLE, NoWhitelistedSchemes());
155 #endif 155 #endif
156 Register(CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, "durable-storage", 156 Register(CONTENT_SETTINGS_TYPE_DURABLE_STORAGE, "durable-storage",
157 CONTENT_SETTING_ASK, WebsiteSettingsInfo::UNSYNCABLE, 157 CONTENT_SETTING_ASK, WebsiteSettingsInfo::UNSYNCABLE,
158 NoWhitelistedSchemes()); 158 NoWhitelistedSchemes());
159 // Register(CONTENT_SETTINGS_TYPE_USB, "usb",
raymes 2015/10/06 05:28:20 I'd suggest naming this one "USB" and the website
Reilly Grant (use Gerrit) 2015/10/06 20:45:30 Okay. I think this will also resolve mlamouri@'s c
160 // CONTENT_SETTING_ALLOW, WebsiteSettingsInfo::UNSYNCABLE,
161 // NoWhitelistedSchemes());
159 162
160 // Content settings that aren't used to store any data. TODO(raymes): use a 163 // Content settings that aren't used to store any data. TODO(raymes): use a
161 // different mechanism rather than content settings to represent these. 164 // different mechanism rather than content settings to represent these.
162 // Since nothing is stored in them, there is no real point in them being a 165 // Since nothing is stored in them, there is no real point in them being a
163 // content setting. 166 // content setting.
164 Register(CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, "protocol-handler", 167 Register(CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS, "protocol-handler",
165 CONTENT_SETTING_DEFAULT, WebsiteSettingsInfo::UNSYNCABLE, 168 CONTENT_SETTING_DEFAULT, WebsiteSettingsInfo::UNSYNCABLE,
166 NoWhitelistedSchemes()); 169 NoWhitelistedSchemes());
167 Register(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, "mixed-script", 170 Register(CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, "mixed-script",
168 CONTENT_SETTING_DEFAULT, WebsiteSettingsInfo::UNSYNCABLE, 171 CONTENT_SETTING_DEFAULT, WebsiteSettingsInfo::UNSYNCABLE,
(...skipping 19 matching lines...) Expand all
188 website_settings_registry_->Register(type, name, default_value.Pass(), 191 website_settings_registry_->Register(type, name, default_value.Pass(),
189 sync_status, 192 sync_status,
190 WebsiteSettingsInfo::NOT_LOSSY); 193 WebsiteSettingsInfo::NOT_LOSSY);
191 DCHECK(!ContainsKey(content_settings_info_, type)); 194 DCHECK(!ContainsKey(content_settings_info_, type));
192 content_settings_info_.set( 195 content_settings_info_.set(
193 type, make_scoped_ptr(new ContentSettingsInfo(website_settings_info, 196 type, make_scoped_ptr(new ContentSettingsInfo(website_settings_info,
194 whitelisted_schemes))); 197 whitelisted_schemes)));
195 } 198 }
196 199
197 } // namespace content_settings 200 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698