OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_CHROMEOS_ARC_ARC_UTIL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_UTIL_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_UTIL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_UTIL_H_ |
7 | 7 |
8 // Most utility should be put in components/arc/arc_util.{h,cc}, rather than | 8 // Most utility should be put in components/arc/arc_util.{h,cc}, rather than |
9 // here. However, some utility implementation requires other modules defined in | 9 // here. However, some utility implementation requires other modules defined in |
10 // chrome/, so this file contains such utilities. | 10 // chrome/, so this file contains such utilities. |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // Disallows ARC for all profiles for testing. | 25 // Disallows ARC for all profiles for testing. |
26 // In most cases, disabling ARC should be done via commandline. However, | 26 // In most cases, disabling ARC should be done via commandline. However, |
27 // there are some cases to be tested where ARC is available, but ARC is not | 27 // there are some cases to be tested where ARC is available, but ARC is not |
28 // supported for some reasons (e.g. incognito mode, supervised user, | 28 // supported for some reasons (e.g. incognito mode, supervised user, |
29 // secondary profile). On the other hand, some test infra does not support | 29 // secondary profile). On the other hand, some test infra does not support |
30 // such situations (e.g. API test). This is for workaround to emulate the | 30 // such situations (e.g. API test). This is for workaround to emulate the |
31 // case. | 31 // case. |
32 void DisallowArcForTesting(); | 32 void DisallowArcForTesting(); |
33 | 33 |
| 34 // Returns whether the user has opted in (or is opting in now) to use Google |
| 35 // Play Store on ARC. |
| 36 // This is almost equivalent to the value of "arc.enabled" preference. However, |
| 37 // in addition, if ARC is not allowed for the given |profile|, then returns |
| 38 // false. Please see detailed condition for the comment of |
| 39 // IsArcAllowedForProfile(). |
| 40 // Note: For historical reason, the preference name is not matched with the |
| 41 // actual meaning. |
| 42 bool IsArcPlayStoreEnabledForProfile(const Profile* profile); |
| 43 |
| 44 // Returns whether the preference "arc.enabled" is managed or not. |
| 45 // It is requirement for a caller to ensure ARC is allowed for the user of |
| 46 // the given |profile|. |
| 47 bool IsArcPlayStoreEnabledPreferenceManagedForProfile(const Profile* profile); |
| 48 |
| 49 // Enables or disables Google Play Store on ARC. Currently, it is tied to |
| 50 // ARC enabled state, too, so this also should trigger to enable or disable |
| 51 // whole ARC system. |
| 52 // If the preference is managed, then no-op. |
| 53 // It is requirement for a caller to ensure ARC is allowed for the user of |
| 54 // the given |profile|. |
| 55 // TODO(hidehiko): De-couple the concept to enable ARC system and opt-in |
| 56 // to use Google Play Store. Note that there is a plan to use ARC without |
| 57 // Google Play Store, then ARC can run without opt-in. |
| 58 void SetArcPlayStoreEnabledForProfile(Profile* profile, bool enabled); |
| 59 |
34 } // namespace arc | 60 } // namespace arc |
35 | 61 |
36 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_UTIL_H_ | 62 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_UTIL_H_ |
OLD | NEW |