Chromium Code Reviews| 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 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 // Migration has happend. New filesystem is in use. | 32 // Migration has happend. New filesystem is in use. |
| 33 kFileSystemCompatible = 1, | 33 kFileSystemCompatible = 1, |
| 34 // Migration has happend, and a notification about the fact was already shown. | 34 // Migration has happend, and a notification about the fact was already shown. |
| 35 kFileSystemCompatibleAndNotified = 2, | 35 kFileSystemCompatibleAndNotified = 2, |
| 36 | 36 |
| 37 // Existing code assumes that kFileSystemIncompatible is the only state | 37 // Existing code assumes that kFileSystemIncompatible is the only state |
| 38 // representing incompatibility and other values are all variants of | 38 // representing incompatibility and other values are all variants of |
| 39 // "compatible" state. Be careful in the case adding a new enum value. | 39 // "compatible" state. Be careful in the case adding a new enum value. |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 // The state of device policy DeviceEcryptfsMigrationStrategy, that points if | |
| 43 // the migration to ext4 encryption is allowed. The ext4 encryption is required | |
| 44 // for ARC(N+). | |
| 45 // TODO(igorcov): Remove this after migration. crbug.com/725493 | |
| 46 enum class ArcAvailabilityPolicyStatus { | |
| 47 // The policy value is unknown. | |
| 48 UNKNOWN = 0, | |
| 49 // ARC is disabled. | |
| 50 DISABLED = 1, | |
| 51 // ARC is available. | |
| 52 AVAILABLE = 2, | |
| 53 }; | |
| 54 | |
| 42 // Returns true if ARC is allowed to run for the given profile. | 55 // Returns true if ARC is allowed to run for the given profile. |
| 43 // Otherwise, returns false, e.g. if the Profile is not for the primary user, | 56 // Otherwise, returns false, e.g. if the Profile is not for the primary user, |
| 44 // ARC is not available on the device, it is in the flow to set up managed | 57 // ARC is not available on the device, it is in the flow to set up managed |
| 45 // account creation. | 58 // account creation. |
| 46 // nullptr can be safely passed to this function. In that case, returns false. | 59 // nullptr can be safely passed to this function. In that case, returns false. |
| 47 bool IsArcAllowedForProfile(const Profile* profile); | 60 bool IsArcAllowedForProfile(const Profile* profile); |
| 48 | 61 |
| 49 // Returns true if the profile is temporarily blocked to run ARC in the current | 62 // Returns true if the profile is temporarily blocked to run ARC in the current |
| 50 // session, because the filesystem storing the profile is incomaptible with the | 63 // session, because the filesystem storing the profile is incomaptible with the |
| 51 // currently installed ARC version. | 64 // currently installed ARC version. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 105 bool AreArcAllOptInPreferencesManagedForProfile(const Profile* profile); | 118 bool AreArcAllOptInPreferencesManagedForProfile(const Profile* profile); |
| 106 | 119 |
| 107 // Checks and updates the preference value whether the underlying filesystem | 120 // Checks and updates the preference value whether the underlying filesystem |
| 108 // for the profile is compatible with ARC, when necessary. After it's done (or | 121 // for the profile is compatible with ARC, when necessary. After it's done (or |
| 109 // skipped), |callback| is run either synchronously or asynchronously. | 122 // skipped), |callback| is run either synchronously or asynchronously. |
| 110 void UpdateArcFileSystemCompatibilityPrefIfNeeded( | 123 void UpdateArcFileSystemCompatibilityPrefIfNeeded( |
| 111 const AccountId& account_id, | 124 const AccountId& account_id, |
| 112 const base::FilePath& profile_path, | 125 const base::FilePath& profile_path, |
| 113 const base::Closure& callback); | 126 const base::Closure& callback); |
| 114 | 127 |
| 128 // Getter for |arc_availability_policy_status|. | |
| 129 ArcAvailabilityPolicyStatus GetArcAvailabilityPolicyStatus(); | |
|
hidehiko
2017/06/07 12:22:20
Can IsMigrationAllowed be usable directly?
I do no
igorcov
2017/06/08 10:42:25
Good point, I've replaced it. Thank you.
| |
| 130 | |
| 131 // For testing IsMigrationAllowed, the global flags have to be reset before | |
| 132 // every test. | |
| 133 void ResetGlobalDataForTesting(); | |
| 134 | |
| 115 } // namespace arc | 135 } // namespace arc |
| 116 | 136 |
| 117 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_UTIL_H_ | 137 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_UTIL_H_ |
| OLD | NEW |