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 CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 // |pref_name|. | 62 // |pref_name|. |
63 virtual PrefService* FindServiceForPref(const std::string& pref_name); | 63 virtual PrefService* FindServiceForPref(const std::string& pref_name); |
64 | 64 |
65 // Returns whether or not the given pref is a CrOS-specific setting. | 65 // Returns whether or not the given pref is a CrOS-specific setting. |
66 virtual bool IsCrosSetting(const std::string& pref_name); | 66 virtual bool IsCrosSetting(const std::string& pref_name); |
67 | 67 |
68 protected: | 68 protected: |
69 // Returns whether |pref_name| corresponds to a pref whose type is URL. | 69 // Returns whether |pref_name| corresponds to a pref whose type is URL. |
70 bool IsPrefTypeURL(const std::string& pref_name); | 70 bool IsPrefTypeURL(const std::string& pref_name); |
71 | 71 |
| 72 #if defined(OS_CHROMEOS) |
| 73 // Returns whether |pref_name| corresponds to a pref that is enterprise |
| 74 // managed. |
| 75 bool IsPrefEnterpriseManaged(const std::string& pref_name); |
| 76 |
| 77 // Returns whether |pref_name| corresponds to a pref that is controlled by |
| 78 // the owner, and |profile_| is not the owner profile. |
| 79 bool IsPrefOwnerControlled(const std::string& pref_name); |
| 80 |
| 81 // Returns whether |pref_name| corresponds to a pref that is controlled by |
| 82 // the primary user, and |profile_| is not the primary profile. |
| 83 bool IsPrefPrimaryUserControlled(const std::string& pref_name); |
| 84 #endif |
| 85 |
| 86 // Returns whether |pref_name| corresponds to a pref that is controlled by |
| 87 // a supervisor, and |profile_| is supervised. |
| 88 bool IsPrefSupervisorControlled(const std::string& pref_name); |
| 89 |
72 // Returns whether |pref_name| corresponds to a pref that is user modifiable | 90 // Returns whether |pref_name| corresponds to a pref that is user modifiable |
73 // (i.e., not made restricted by a user or device policy). | 91 // (i.e., not made restricted by a user or device policy). |
74 bool IsPrefUserModifiable(const std::string& pref_name); | 92 bool IsPrefUserModifiable(const std::string& pref_name); |
75 | 93 |
76 api::settings_private::PrefType GetType(const std::string& name, | 94 api::settings_private::PrefType GetType(const std::string& name, |
77 base::Value::Type type); | 95 base::Value::Type type); |
78 | 96 |
79 scoped_ptr<api::settings_private::PrefObject> GetCrosSettingsPref( | 97 scoped_ptr<api::settings_private::PrefObject> GetCrosSettingsPref( |
80 const std::string& name); | 98 const std::string& name); |
81 | 99 |
82 SetPrefResult SetCrosSettingsPref(const std::string& name, | 100 SetPrefResult SetCrosSettingsPref(const std::string& name, |
83 const base::Value* value); | 101 const base::Value* value); |
84 | 102 |
85 Profile* profile_; // weak | 103 Profile* profile_; // weak |
86 }; | 104 }; |
87 | 105 |
88 } // namespace extensions | 106 } // namespace extensions |
89 | 107 |
90 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ | 108 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ |
OLD | NEW |