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