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 // 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. |
| 11 // Note that it is not allowed to have dependency from components/ to chrome/ | 11 // Note that it is not allowed to have dependency from components/ to chrome/ |
| 12 // by DEPS. | 12 // by DEPS. |
| 13 | 13 |
| 14 class Profile; | 14 class Profile; |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class FilePath; | 17 class FilePath; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace arc { | 20 namespace arc { |
| 21 | 21 |
| 22 // Returns true if ARC is allowed to run for the given profile. | 22 // Returns true if ARC is allowed to run for the given profile. |
| 23 // Otherwise, returns false, e.g. if the Profile is not for the primary user, | 23 // Otherwise, returns false, e.g. if the Profile is not for the primary user, |
| 24 // ARC is not available on the device, it is in the flow to set up managed | 24 // ARC is not available on the device, it is in the flow to set up managed |
| 25 // account creation. | 25 // account creation. |
| 26 // nullptr can be safely passed to this function. In that case, returns false. | 26 // nullptr can be safely passed to this function. In that case, returns false. |
| 27 bool IsArcAllowedForProfile(const Profile* profile); | 27 bool IsArcAllowedForProfile(const Profile* profile); |
| 28 | 28 |
| 29 // Returns true if ARC app is allowed to show up on app list for the given | |
| 30 // profile. This can be a looser condition than IsArcAllowedForProfile. | |
| 31 // ARC may be temporaliry disallowed for the profile, but it may become again | |
| 32 // avaiable after the user's action. ARC app list can stay there to ease the | |
| 33 // user (by showing apps not gone) and to give a guide for the action. | |
| 34 bool IsArcAllowedInAppListForProfile(const Profile* profile); | |
| 35 | |
| 36 // Returns true if the profile is already marked to be on a filesystem | |
| 37 // compatible to the currently installed ARC version. The check almost never | |
| 38 // is meaningful on test workstation. Usually it should be checked only when | |
| 39 // running on the real Chrome OS. | |
| 40 bool IsProfileVerifiedToBeOnArcCompatibleFilesystem(const Profile* profile); | |
|
hidehiko
2017/04/10 08:50:55
Functions here is started with "Be-verb + Arc", ho
kinaba
2017/04/10 09:13:01
Done.
| |
| 41 | |
| 29 // Disallows ARC for all profiles for testing. | 42 // Disallows ARC for all profiles for testing. |
| 30 // In most cases, disabling ARC should be done via commandline. However, | 43 // In most cases, disabling ARC should be done via commandline. However, |
| 31 // there are some cases to be tested where ARC is available, but ARC is not | 44 // there are some cases to be tested where ARC is available, but ARC is not |
| 32 // supported for some reasons (e.g. incognito mode, supervised user, | 45 // supported for some reasons (e.g. incognito mode, supervised user, |
| 33 // secondary profile). On the other hand, some test infra does not support | 46 // secondary profile). On the other hand, some test infra does not support |
| 34 // such situations (e.g. API test). This is for workaround to emulate the | 47 // such situations (e.g. API test). This is for workaround to emulate the |
| 35 // case. | 48 // case. |
| 36 void DisallowArcForTesting(); | 49 void DisallowArcForTesting(); |
| 37 | 50 |
| 38 // Returns whether the user has opted in (or is opting in now) to use Google | 51 // Returns whether the user has opted in (or is opting in now) to use Google |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 65 // ArcBackupRestoreEnabled and ArcLocationServiceEnabled) are managed. | 78 // ArcBackupRestoreEnabled and ArcLocationServiceEnabled) are managed. |
| 66 bool AreArcAllOptInPreferencesManagedForProfile(const Profile* profile); | 79 bool AreArcAllOptInPreferencesManagedForProfile(const Profile* profile); |
| 67 | 80 |
| 68 // Returns whether ARC can run on the filesystem mounted at |path|. | 81 // Returns whether ARC can run on the filesystem mounted at |path|. |
| 69 // This function should run only on threads where IO operations are allowed. | 82 // This function should run only on threads where IO operations are allowed. |
| 70 bool IsArcCompatibleFilesystem(const base::FilePath& path); | 83 bool IsArcCompatibleFilesystem(const base::FilePath& path); |
| 71 | 84 |
| 72 } // namespace arc | 85 } // namespace arc |
| 73 | 86 |
| 74 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_UTIL_H_ | 87 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_UTIL_H_ |
| OLD | NEW |