Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: components/arc/arc_util.h

Issue 2890843002: Policy implementation for encryptfs to ext4 migration strategy (Closed)
Patch Set: Implementation Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 arc { 20 namespace arc {
21 21
22 constexpr char kAvailabilityOfficiallySupportedWithMigration[] =
23 "officially-supported-with-migration";
hidehiko 2017/05/25 12:41:56 As commented in design doc, could you introduce an
igorcov 2017/05/31 17:25:36 Done.
24
25 // The state of device policy DeviceEcryptfsMigrationStrategy, that points if
26 // the migration to ext4 encryption is allowed. The ext4 encryption is required
27 // for ARC(N+).
28 // TODO(igorcov): Remove this after migration. crbug.com/725493
29 enum ARC_AVAILABILITY_POLICY_STATUS {
hidehiko 2017/05/25 12:41:56 nit: please use enum class. style: Please use Cam
igorcov 2017/05/31 17:25:36 Done.
30 // The policy value is unknown.
31 UNKNOWN = 0,
32 // ARC is disabled.
33 DISABLED = 1,
34 // ARC is available.
35 AVAILABLE = 2,
36 };
37
38 // This flag should be set the first time the policy fetch is done. It is to be
39 // used if the device is set to need ext4 migration. In case its value is
40 // UNKNOWN, the device is considered consumer owned.
41 // TODO(igorcov): Remove this after migration. crbug.com/725493
42 extern ARC_AVAILABILITY_POLICY_STATUS arc_availability_policy_status;
hidehiko 2017/05/25 12:41:56 Please remove. extern decl is not needed.
igorcov 2017/05/31 17:25:36 Done.
43
22 // Returns true if ARC is installed and the current device is officially 44 // Returns true if ARC is installed and the current device is officially
23 // supported to run ARC. 45 // supported to run ARC.
24 // Note that, to run ARC practically, it is necessary to meet more conditions, 46 // Note that, to run ARC practically, it is necessary to meet more conditions,
25 // e.g., ARC supports only on Primary User Profile. To see if ARC can actually 47 // e.g., ARC supports only on Primary User Profile. To see if ARC can actually
26 // run for the profile etc., arc::ArcSessionManager::IsAllowedForProfile() is 48 // run for the profile etc., arc::ArcSessionManager::IsAllowedForProfile() is
27 // the function for that purpose. Please see also its comment, too. 49 // the function for that purpose. Please see also its comment, too.
28 // Also note that, ARC singleton classes (e.g. ArcSessionManager, 50 // Also note that, ARC singleton classes (e.g. ArcSessionManager,
29 // ArcServiceManager, ArcServiceLauncher) are instantiated regardless of this 51 // ArcServiceManager, ArcServiceLauncher) are instantiated regardless of this
30 // check, so it is ok to access them directly. 52 // check, so it is ok to access them directly.
31 bool IsArcAvailable(); 53 bool IsArcAvailable();
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 bool IsArcKioskMode(); 85 bool IsArcKioskMode();
64 86
65 // Checks if opt-in verification was disabled by switch in command line. 87 // Checks if opt-in verification was disabled by switch in command line.
66 // In most cases, it is disabled for testing purpose. 88 // In most cases, it is disabled for testing purpose.
67 bool IsArcOptInVerificationDisabled(); 89 bool IsArcOptInVerificationDisabled();
68 90
69 // Returns true if the |window|'s aura::client::kAppType is ARC_APP. When 91 // Returns true if the |window|'s aura::client::kAppType is ARC_APP. When
70 // |window| is nullptr, returns false. 92 // |window| is nullptr, returns false.
71 bool IsArcAppWindow(aura::Window* window); 93 bool IsArcAppWindow(aura::Window* window);
72 94
95 // Setter for |arc_availability_policy_status|.
96 void SetArcAvailabilityPolicyStatus(ARC_AVAILABILITY_POLICY_STATUS status);
hidehiko 2017/05/25 12:41:56 Please explicitly document by-when this must be ca
97
98 // Getter for |arc_availability_policy_status|.
99 ARC_AVAILABILITY_POLICY_STATUS GetArcAvailabilityPolicyStatus();
100
73 } // namespace arc 101 } // namespace arc
74 102
75 #endif // COMPONENTS_ARC_ARC_UTIL_H_ 103 #endif // COMPONENTS_ARC_ARC_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698