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 COMPONENTS_ARC_ARC_UTIL_H_ | 5 #ifndef COMPONENTS_ARC_ARC_UTIL_H_ |
| 6 #define COMPONENTS_ARC_ARC_UTIL_H_ | 6 #define COMPONENTS_ARC_ARC_UTIL_H_ |
| 7 | 7 |
| 8 // This file contains utility to see ARC functionality status controlled by | 8 // This file contains utility to see ARC functionality status controlled by |
| 9 // outside of ARC, e.g. CommandLine flag, attribute of global data/state, | 9 // outside of ARC, e.g. CommandLine flag, attribute of global data/state, |
| 10 // users' preferences, and FeatureList. | 10 // users' preferences, and FeatureList. |
| 11 | 11 |
| 12 namespace aura { | 12 namespace aura { |
| 13 class Window; | 13 class Window; |
| 14 } // namespace aura | 14 } // namespace aura |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 class CommandLine; | 17 class CommandLine; |
| 18 } // namespace base | 18 } // namespace base |
| 19 | 19 |
| 20 namespace user_manager { | 20 namespace user_manager { |
| 21 class User; | 21 class User; |
| 22 } // namespace user_manager | 22 } // namespace user_manager |
| 23 | 23 |
| 24 namespace arc { | 24 namespace arc { |
| 25 | 25 |
| 26 // The state of device policy DeviceEcryptfsMigrationStrategy, that points if | |
| 27 // the migration to ext4 encryption is allowed. The ext4 encryption is required | |
| 28 // for ARC(N+). | |
| 29 // TODO(igorcov): Remove this after migration. crbug.com/725493 | |
| 30 enum ArcAvailabilityPolicyStatus { | |
|
hidehiko
2017/06/01 16:07:16
enum class, please.
| |
| 31 // The policy value is unknown. | |
| 32 UNKNOWN = 0, | |
| 33 // ARC is disabled. | |
| 34 DISABLED = 1, | |
| 35 // ARC is available. | |
| 36 AVAILABLE = 2, | |
| 37 }; | |
| 38 | |
| 26 // Returns true if ARC is installed and the current device is officially | 39 // Returns true if ARC is installed and the current device is officially |
| 27 // supported to run ARC. | 40 // supported to run ARC. |
| 28 // Note that, to run ARC practically, it is necessary to meet more conditions, | 41 // Note that, to run ARC practically, it is necessary to meet more conditions, |
| 29 // e.g., ARC supports only on Primary User Profile. To see if ARC can actually | 42 // e.g., ARC supports only on Primary User Profile. To see if ARC can actually |
| 30 // run for the profile etc., arc::ArcSessionManager::IsAllowedForProfile() is | 43 // run for the profile etc., arc::ArcSessionManager::IsAllowedForProfile() is |
| 31 // the function for that purpose. Please see also its comment, too. | 44 // the function for that purpose. Please see also its comment, too. |
| 32 // Also note that, ARC singleton classes (e.g. ArcSessionManager, | 45 // Also note that, ARC singleton classes (e.g. ArcSessionManager, |
| 33 // ArcServiceManager, ArcServiceLauncher) are instantiated regardless of this | 46 // ArcServiceManager, ArcServiceLauncher) are instantiated regardless of this |
| 34 // check, so it is ok to access them directly. | 47 // check, so it is ok to access them directly. |
| 35 bool IsArcAvailable(); | 48 bool IsArcAvailable(); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 | 92 |
| 80 // Returns true if the |window|'s aura::client::kAppType is ARC_APP. When | 93 // Returns true if the |window|'s aura::client::kAppType is ARC_APP. When |
| 81 // |window| is nullptr, returns false. | 94 // |window| is nullptr, returns false. |
| 82 bool IsArcAppWindow(aura::Window* window); | 95 bool IsArcAppWindow(aura::Window* window); |
| 83 | 96 |
| 84 // Adjusts the amount of CPU the ARC instance is allowed to use. When | 97 // Adjusts the amount of CPU the ARC instance is allowed to use. When |
| 85 // |do_restrict| is true, the limit is adjusted so ARC can only use tightly | 98 // |do_restrict| is true, the limit is adjusted so ARC can only use tightly |
| 86 // restricted CPU resources. | 99 // restricted CPU resources. |
| 87 void SetArcCpuRestriction(bool do_restrict); | 100 void SetArcCpuRestriction(bool do_restrict); |
| 88 | 101 |
| 102 // Getter for |arc_availability_policy_status|. | |
| 103 ArcAvailabilityPolicyStatus GetArcAvailabilityPolicyStatus(); | |
| 104 | |
| 105 // Set the flag that it's consumer owned device. | |
| 106 void SetHasDeviceOwner(); | |
| 107 | |
| 108 // For testing IsMigrationAllowed, the global flags have to be reset before | |
| 109 // every test. | |
| 110 void ResetGlobalDataForTesting(); | |
| 111 | |
| 89 } // namespace arc | 112 } // namespace arc |
| 90 | 113 |
| 91 #endif // COMPONENTS_ARC_ARC_UTIL_H_ | 114 #endif // COMPONENTS_ARC_ARC_UTIL_H_ |
| OLD | NEW |