| 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 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_REGISTRY_H_ | 5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_REGISTRY_H_ |
| 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_REGISTRY_H_ | 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/containers/scoped_ptr_map.h" |
| 10 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_ptr.h" |
| 13 #include "components/content_settings/core/browser/content_settings_info.h" | 14 #include "components/content_settings/core/browser/content_settings_info.h" |
| 14 #include "components/content_settings/core/browser/website_settings_info.h" | 15 #include "components/content_settings/core/browser/website_settings_info.h" |
| 15 #include "components/content_settings/core/common/content_settings.h" | 16 #include "components/content_settings/core/common/content_settings.h" |
| 16 #include "components/content_settings/core/common/content_settings_types.h" | 17 #include "components/content_settings/core/common/content_settings_types.h" |
| 17 | 18 |
| 18 namespace content_settings { | 19 namespace content_settings { |
| 19 | 20 |
| 20 class WebsiteSettingsRegistry; | 21 class WebsiteSettingsRegistry; |
| 21 | 22 |
| 22 // This class stores ContentSettingsInfo objects for each content setting in the | 23 // This class stores ContentSettingsInfo objects for each content setting in the |
| (...skipping 20 matching lines...) Expand all Loading... |
| 43 void Init(); | 44 void Init(); |
| 44 | 45 |
| 45 // Register a new content setting. This maps an origin to an ALLOW/ASK/BLOCK | 46 // Register a new content setting. This maps an origin to an ALLOW/ASK/BLOCK |
| 46 // value (see the ContentSetting enum). | 47 // value (see the ContentSetting enum). |
| 47 void Register(ContentSettingsType type, | 48 void Register(ContentSettingsType type, |
| 48 const std::string& name, | 49 const std::string& name, |
| 49 ContentSetting initial_default_value, | 50 ContentSetting initial_default_value, |
| 50 WebsiteSettingsInfo::SyncStatus sync_status, | 51 WebsiteSettingsInfo::SyncStatus sync_status, |
| 51 const std::vector<std::string>& whitelisted_schemes); | 52 const std::vector<std::string>& whitelisted_schemes); |
| 52 | 53 |
| 53 ScopedVector<ContentSettingsInfo> content_settings_info_; | 54 base::ScopedPtrMap<ContentSettingsType, scoped_ptr<ContentSettingsInfo>> |
| 55 content_settings_info_; |
| 54 WebsiteSettingsRegistry* website_settings_registry_; | 56 WebsiteSettingsRegistry* website_settings_registry_; |
| 55 | 57 |
| 56 DISALLOW_COPY_AND_ASSIGN(ContentSettingsRegistry); | 58 DISALLOW_COPY_AND_ASSIGN(ContentSettingsRegistry); |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 } // namespace content_settings | 61 } // namespace content_settings |
| 60 | 62 |
| 61 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_REGISTRY_H_ | 63 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_CONTENT_SETTINGS_REGISTRY_H_ |
| OLD | NEW |