| 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" |
| 11 #include "base/memory/ptr_util.h" | 11 #include "base/memory/ptr_util.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "components/content_settings/core/browser/content_settings_utils.h" | 15 #include "components/content_settings/core/browser/content_settings_utils.h" |
| 16 #include "components/content_settings/core/browser/website_settings_registry.h" | 16 #include "components/content_settings/core/browser/website_settings_registry.h" |
| 17 #include "components/content_settings/core/common/content_settings.h" | 17 #include "components/content_settings/core/common/content_settings.h" |
| 18 | 18 |
| 19 namespace content_settings { | 19 namespace content_settings { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 base::LazyInstance<ContentSettingsRegistry> g_instance = | 23 base::LazyInstance<ContentSettingsRegistry>::DestructorAtExit g_instance = |
| 24 LAZY_INSTANCE_INITIALIZER; | 24 LAZY_INSTANCE_INITIALIZER; |
| 25 | 25 |
| 26 // TODO(raymes): These overloaded functions make the registration code clearer. | 26 // TODO(raymes): These overloaded functions make the registration code clearer. |
| 27 // When initializer lists are available they won't be needed. The initializer | 27 // When initializer lists are available they won't be needed. The initializer |
| 28 // list can be implicitly or explicitly converted to a std::vector. | 28 // list can be implicitly or explicitly converted to a std::vector. |
| 29 std::vector<std::string> WhitelistedSchemes() { | 29 std::vector<std::string> WhitelistedSchemes() { |
| 30 return std::vector<std::string>(); | 30 return std::vector<std::string>(); |
| 31 } | 31 } |
| 32 | 32 |
| 33 std::vector<std::string> WhitelistedSchemes(const char* scheme1, | 33 std::vector<std::string> WhitelistedSchemes(const char* scheme1, |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |