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_WEBSITE_SETTINGS_REGISTRY_H_ | 5 #ifndef COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_WEBSITE_SETTINGS_REGISTRY_H_ |
6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_WEBSITE_SETTINGS_REGISTRY_H_ | 6 #define COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_WEBSITE_SETTINGS_REGISTRY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 22 matching lines...) Expand all Loading... | |
33 static WebsiteSettingsRegistry* GetInstance(); | 33 static WebsiteSettingsRegistry* GetInstance(); |
34 | 34 |
35 // Reset the instance for use inside tests. | 35 // Reset the instance for use inside tests. |
36 void ResetForTest(); | 36 void ResetForTest(); |
37 | 37 |
38 const WebsiteSettingsInfo* Get(ContentSettingsType type) const; | 38 const WebsiteSettingsInfo* Get(ContentSettingsType type) const; |
39 const WebsiteSettingsInfo* GetByName(const std::string& name) const; | 39 const WebsiteSettingsInfo* GetByName(const std::string& name) const; |
40 | 40 |
41 // Register a new website setting. This maps an origin to an arbitrary | 41 // Register a new website setting. This maps an origin to an arbitrary |
42 // base::Value. Returns a pointer to the registered WebsiteSettingsInfo which | 42 // base::Value. Returns a pointer to the registered WebsiteSettingsInfo which |
43 // is owned by the registry. | 43 // is owned by the registry. |
raymes
2016/05/25 03:36:07
I think we should add a comment which says that a
lshang
2016/05/25 10:38:16
Done.
| |
44 const WebsiteSettingsInfo* Register( | 44 const WebsiteSettingsInfo* Register( |
45 ContentSettingsType type, | 45 ContentSettingsType type, |
46 const std::string& name, | 46 const std::string& name, |
47 std::unique_ptr<base::Value> initial_default_value, | 47 std::unique_ptr<base::Value> initial_default_value, |
48 WebsiteSettingsInfo::SyncStatus sync_status, | 48 WebsiteSettingsInfo::SyncStatus sync_status, |
49 WebsiteSettingsInfo::LossyStatus lossy_status, | 49 WebsiteSettingsInfo::LossyStatus lossy_status, |
50 WebsiteSettingsInfo::ScopingType scoping_type, | 50 WebsiteSettingsInfo::ScopingType scoping_type, |
51 uint32_t platform, | |
raymes
2016/05/25 03:36:07
nit: platforms
lshang
2016/05/25 10:38:16
Done.
| |
51 WebsiteSettingsInfo::IncognitoBehavior incognito_behavior); | 52 WebsiteSettingsInfo::IncognitoBehavior incognito_behavior); |
52 | 53 |
53 const_iterator begin() const; | 54 const_iterator begin() const; |
54 const_iterator end() const; | 55 const_iterator end() const; |
55 | 56 |
56 private: | 57 private: |
57 friend class ContentSettingsRegistryTest; | 58 friend class ContentSettingsRegistryTest; |
58 friend class WebsiteSettingsRegistryTest; | 59 friend class WebsiteSettingsRegistryTest; |
59 friend struct base::DefaultLazyInstanceTraits<WebsiteSettingsRegistry>; | 60 friend struct base::DefaultLazyInstanceTraits<WebsiteSettingsRegistry>; |
60 | 61 |
61 WebsiteSettingsRegistry(); | 62 WebsiteSettingsRegistry(); |
62 ~WebsiteSettingsRegistry(); | 63 ~WebsiteSettingsRegistry(); |
63 | 64 |
64 void Init(); | 65 void Init(); |
65 | 66 |
66 Map website_settings_info_; | 67 Map website_settings_info_; |
67 | 68 |
68 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsRegistry); | 69 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsRegistry); |
69 }; | 70 }; |
70 | 71 |
71 } // namespace content_settings | 72 } // namespace content_settings |
72 | 73 |
73 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_WEBSITE_SETTINGS_REGISTRY_H_ | 74 #endif // COMPONENTS_CONTENT_SETTINGS_CORE_BROWSER_WEBSITE_SETTINGS_REGISTRY_H_ |
OLD | NEW |