| 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 ContentSetting initial_default_value, | 316 ContentSetting initial_default_value, |
| 317 WebsiteSettingsInfo::SyncStatus sync_status, | 317 WebsiteSettingsInfo::SyncStatus sync_status, |
| 318 const std::vector<std::string>& whitelisted_schemes, | 318 const std::vector<std::string>& whitelisted_schemes, |
| 319 const std::set<ContentSetting>& valid_settings, | 319 const std::set<ContentSetting>& valid_settings, |
| 320 WebsiteSettingsInfo::ScopingType scoping_type, | 320 WebsiteSettingsInfo::ScopingType scoping_type, |
| 321 Platforms platforms, | 321 Platforms platforms, |
| 322 ContentSettingsInfo::IncognitoBehavior incognito_behavior) { | 322 ContentSettingsInfo::IncognitoBehavior incognito_behavior) { |
| 323 // Ensure that nothing has been registered yet for the given type. | 323 // Ensure that nothing has been registered yet for the given type. |
| 324 DCHECK(!website_settings_registry_->Get(type)); | 324 DCHECK(!website_settings_registry_->Get(type)); |
| 325 std::unique_ptr<base::Value> default_value( | 325 std::unique_ptr<base::Value> default_value( |
| 326 new base::FundamentalValue(static_cast<int>(initial_default_value))); | 326 new base::Value(static_cast<int>(initial_default_value))); |
| 327 const WebsiteSettingsInfo* website_settings_info = | 327 const WebsiteSettingsInfo* website_settings_info = |
| 328 website_settings_registry_->Register( | 328 website_settings_registry_->Register( |
| 329 type, name, std::move(default_value), sync_status, | 329 type, name, std::move(default_value), sync_status, |
| 330 WebsiteSettingsInfo::NOT_LOSSY, scoping_type, platforms, | 330 WebsiteSettingsInfo::NOT_LOSSY, scoping_type, platforms, |
| 331 WebsiteSettingsInfo::INHERIT_IN_INCOGNITO); | 331 WebsiteSettingsInfo::INHERIT_IN_INCOGNITO); |
| 332 | 332 |
| 333 // WebsiteSettingsInfo::Register() will return nullptr if content setting type | 333 // WebsiteSettingsInfo::Register() will return nullptr if content setting type |
| 334 // is not used on the current platform and doesn't need to be registered. | 334 // is not used on the current platform and doesn't need to be registered. |
| 335 if (!website_settings_info) | 335 if (!website_settings_info) |
| 336 return; | 336 return; |
| 337 | 337 |
| 338 DCHECK(!base::ContainsKey(content_settings_info_, type)); | 338 DCHECK(!base::ContainsKey(content_settings_info_, type)); |
| 339 content_settings_info_[type] = base::MakeUnique<ContentSettingsInfo>( | 339 content_settings_info_[type] = base::MakeUnique<ContentSettingsInfo>( |
| 340 website_settings_info, whitelisted_schemes, valid_settings, | 340 website_settings_info, whitelisted_schemes, valid_settings, |
| 341 incognito_behavior); | 341 incognito_behavior); |
| 342 } | 342 } |
| 343 | 343 |
| 344 } // namespace content_settings | 344 } // namespace content_settings |
| OLD | NEW |