| OLD | NEW |
| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE); | 301 ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE); |
| 302 | 302 |
| 303 Register(CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD, "bluetooth-guard", | 303 Register(CONTENT_SETTINGS_TYPE_BLUETOOTH_GUARD, "bluetooth-guard", |
| 304 CONTENT_SETTING_ASK, WebsiteSettingsInfo::UNSYNCABLE, | 304 CONTENT_SETTING_ASK, WebsiteSettingsInfo::UNSYNCABLE, |
| 305 WhitelistedSchemes(), | 305 WhitelistedSchemes(), |
| 306 ValidSettings(CONTENT_SETTING_ASK, CONTENT_SETTING_BLOCK), | 306 ValidSettings(CONTENT_SETTING_ASK, CONTENT_SETTING_BLOCK), |
| 307 WebsiteSettingsInfo::REQUESTING_ORIGIN_AND_TOP_LEVEL_ORIGIN_SCOPE, | 307 WebsiteSettingsInfo::REQUESTING_ORIGIN_AND_TOP_LEVEL_ORIGIN_SCOPE, |
| 308 WebsiteSettingsRegistry::DESKTOP | | 308 WebsiteSettingsRegistry::DESKTOP | |
| 309 WebsiteSettingsRegistry::PLATFORM_ANDROID, | 309 WebsiteSettingsRegistry::PLATFORM_ANDROID, |
| 310 ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE); | 310 ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE); |
| 311 |
| 312 Register(CONTENT_SETTINGS_TYPE_AMBIENT_LIGHT_SENSOR, "ambient-light-sensor", |
| 313 CONTENT_SETTING_ALLOW, WebsiteSettingsInfo::UNSYNCABLE, |
| 314 WhitelistedSchemes(), |
| 315 ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, |
| 316 CONTENT_SETTING_ASK), |
| 317 WebsiteSettingsInfo::REQUESTING_ORIGIN_AND_TOP_LEVEL_ORIGIN_SCOPE, |
| 318 WebsiteSettingsRegistry::DESKTOP | |
| 319 WebsiteSettingsRegistry::PLATFORM_ANDROID, |
| 320 ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE); |
| 321 Register(CONTENT_SETTINGS_TYPE_MAGNETOMETER, "magnetometer", |
| 322 CONTENT_SETTING_ALLOW, WebsiteSettingsInfo::UNSYNCABLE, |
| 323 WhitelistedSchemes(), |
| 324 ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, |
| 325 CONTENT_SETTING_ASK), |
| 326 WebsiteSettingsInfo::REQUESTING_ORIGIN_AND_TOP_LEVEL_ORIGIN_SCOPE, |
| 327 WebsiteSettingsRegistry::DESKTOP | |
| 328 WebsiteSettingsRegistry::PLATFORM_ANDROID, |
| 329 ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE); |
| 330 Register(CONTENT_SETTINGS_TYPE_ORIENTATION_SENSOR, "orientation-sensor", |
| 331 CONTENT_SETTING_ALLOW, WebsiteSettingsInfo::UNSYNCABLE, |
| 332 WhitelistedSchemes(), |
| 333 ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK, |
| 334 CONTENT_SETTING_ASK), |
| 335 WebsiteSettingsInfo::REQUESTING_ORIGIN_AND_TOP_LEVEL_ORIGIN_SCOPE, |
| 336 WebsiteSettingsRegistry::DESKTOP | |
| 337 WebsiteSettingsRegistry::PLATFORM_ANDROID, |
| 338 ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE); |
| 311 } | 339 } |
| 312 | 340 |
| 313 void ContentSettingsRegistry::Register( | 341 void ContentSettingsRegistry::Register( |
| 314 ContentSettingsType type, | 342 ContentSettingsType type, |
| 315 const std::string& name, | 343 const std::string& name, |
| 316 ContentSetting initial_default_value, | 344 ContentSetting initial_default_value, |
| 317 WebsiteSettingsInfo::SyncStatus sync_status, | 345 WebsiteSettingsInfo::SyncStatus sync_status, |
| 318 const std::vector<std::string>& whitelisted_schemes, | 346 const std::vector<std::string>& whitelisted_schemes, |
| 319 const std::set<ContentSetting>& valid_settings, | 347 const std::set<ContentSetting>& valid_settings, |
| 320 WebsiteSettingsInfo::ScopingType scoping_type, | 348 WebsiteSettingsInfo::ScopingType scoping_type, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 335 if (!website_settings_info) | 363 if (!website_settings_info) |
| 336 return; | 364 return; |
| 337 | 365 |
| 338 DCHECK(!base::ContainsKey(content_settings_info_, type)); | 366 DCHECK(!base::ContainsKey(content_settings_info_, type)); |
| 339 content_settings_info_[type] = base::MakeUnique<ContentSettingsInfo>( | 367 content_settings_info_[type] = base::MakeUnique<ContentSettingsInfo>( |
| 340 website_settings_info, whitelisted_schemes, valid_settings, | 368 website_settings_info, whitelisted_schemes, valid_settings, |
| 341 incognito_behavior); | 369 incognito_behavior); |
| 342 } | 370 } |
| 343 | 371 |
| 344 } // namespace content_settings | 372 } // namespace content_settings |
| OLD | NEW |