Chromium Code Reviews| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 52 // |pref_name|. | 52 // |pref_name|. |
| 53 virtual PrefService* FindServiceForPref(const std::string& pref_name); | 53 virtual PrefService* FindServiceForPref(const std::string& pref_name); |
| 54 | 54 |
| 55 // Returns whether or not the given pref is a CrOS-specific setting. | 55 // Returns whether or not the given pref is a CrOS-specific setting. |
| 56 virtual bool IsCrosSetting(const std::string& pref_name); | 56 virtual bool IsCrosSetting(const std::string& pref_name); |
| 57 | 57 |
| 58 protected: | 58 protected: |
| 59 // Returns whether |pref_name| corresponds to a pref whose type is URL. | 59 // Returns whether |pref_name| corresponds to a pref whose type is URL. |
| 60 bool IsPrefTypeURL(const std::string& pref_name); | 60 bool IsPrefTypeURL(const std::string& pref_name); |
| 61 | 61 |
| 62 // Returns whether |pref_name| corresponds to a pref that is enterprise | |
| 63 // managed (Chrome OS only). | |
| 64 bool IsPrefEnterpriseManaged(const std::string& pref_name); | |
| 65 | |
| 66 // Returns whether |pref_name| corresponds to a pref that is controlled by | |
| 67 // the owner, and |profile_| is not the owner profile. | |
|
michaelpg
2015/08/27 23:40:01
Chrome OS only.
Dan Beam
2015/08/28 00:20:22
can it be in if-defs, then?
stevenjb
2015/08/28 23:18:07
Done.
| |
| 68 bool IsPrefOwnerControlled(const std::string& pref_name); | |
| 69 | |
| 70 // Returns whether |pref_name| corresponds to a pref that is controlled by | |
| 71 // a supervisor, and |profile_| is supervised. | |
| 72 bool IsPrefSupervisorControlled(const std::string& pref_name); | |
| 73 | |
| 74 // Returns whether |pref_name| corresponds to a pref that is controlled by | |
| 75 // the primary user, and |profile_| is not the primary profile. | |
|
michaelpg
2015/08/27 23:40:01
Chrome OS only, right?
stevenjb
2015/08/28 23:18:07
Yes, done.
| |
| 76 bool IsPrefPrimaryUserControlled(const std::string& pref_name); | |
| 77 | |
| 62 // Returns whether |pref_name| corresponds to a pref that is user modifiable | 78 // Returns whether |pref_name| corresponds to a pref that is user modifiable |
| 63 // (i.e., not made restricted by a user or device policy). | 79 // (i.e., not made restricted by a user or device policy). |
| 64 bool IsPrefUserModifiable(const std::string& pref_name); | 80 bool IsPrefUserModifiable(const std::string& pref_name); |
| 65 | 81 |
| 66 api::settings_private::PrefType GetType(const std::string& name, | 82 api::settings_private::PrefType GetType(const std::string& name, |
| 67 base::Value::Type type); | 83 base::Value::Type type); |
| 68 | 84 |
| 69 scoped_ptr<api::settings_private::PrefObject> GetCrosSettingsPref( | 85 scoped_ptr<api::settings_private::PrefObject> GetCrosSettingsPref( |
| 70 const std::string& name); | 86 const std::string& name); |
| 71 | 87 |
| 72 bool SetCrosSettingsPref(const std::string& name, const base::Value* value); | 88 bool SetCrosSettingsPref(const std::string& name, const base::Value* value); |
| 73 | 89 |
| 74 Profile* profile_; // weak | 90 Profile* profile_; // weak |
| 75 }; | 91 }; |
| 76 | 92 |
| 77 } // namespace extensions | 93 } // namespace extensions |
| 78 | 94 |
| 79 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ | 95 #endif // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_PREFS_UTIL_H_ |
| OLD | NEW |