| 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 { |
| 21 class User; |
| 22 } // namespace user_manager |
| 23 |
| 20 namespace arc { | 24 namespace arc { |
| 21 | 25 |
| 22 // Returns true if ARC is installed and the current device is officially | 26 // Returns true if ARC is installed and the current device is officially |
| 23 // supported to run ARC. | 27 // supported to run ARC. |
| 24 // Note that, to run ARC practically, it is necessary to meet more conditions, | 28 // 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 | 29 // 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 | 30 // run for the profile etc., arc::ArcSessionManager::IsAllowedForProfile() is |
| 27 // the function for that purpose. Please see also its comment, too. | 31 // the function for that purpose. Please see also its comment, too. |
| 28 // Also note that, ARC singleton classes (e.g. ArcSessionManager, | 32 // Also note that, ARC singleton classes (e.g. ArcSessionManager, |
| 29 // ArcServiceManager, ArcServiceLauncher) are instantiated regardless of this | 33 // ArcServiceManager, ArcServiceLauncher) are instantiated regardless of this |
| (...skipping 25 matching lines...) Expand all Loading... |
| 55 // base::CommandLine::ForCurrentProcess(). | 59 // base::CommandLine::ForCurrentProcess(). |
| 56 // |command_line| must not be nullptr. | 60 // |command_line| must not be nullptr. |
| 57 void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line); | 61 void SetArcAvailableCommandLineForTesting(base::CommandLine* command_line); |
| 58 | 62 |
| 59 // Returns true if ARC should run under Kiosk mode for the current profile. | 63 // Returns true if ARC should run under Kiosk mode for the current profile. |
| 60 // As it can return true only when user is already initialized, it implies | 64 // As it can return true only when user is already initialized, it implies |
| 61 // that ARC availability was checked before and IsArcKioskAvailable() | 65 // that ARC availability was checked before and IsArcKioskAvailable() |
| 62 // should also return true in that case. | 66 // should also return true in that case. |
| 63 bool IsArcKioskMode(); | 67 bool IsArcKioskMode(); |
| 64 | 68 |
| 69 // Returns true if ARC is allowed for the given user. Note this should not be |
| 70 // used as a signal of whether ARC is allowed alone because it only considers |
| 71 // user meta data. e.g. a user could be allowed for ARC but if the user signs in |
| 72 // as a secondary user or signs in to create a supervised user, ARC should be |
| 73 // disabled for such cases. |
| 74 bool IsArcAllowedForUser(const user_manager::User* user); |
| 75 |
| 65 // Checks if opt-in verification was disabled by switch in command line. | 76 // Checks if opt-in verification was disabled by switch in command line. |
| 66 // In most cases, it is disabled for testing purpose. | 77 // In most cases, it is disabled for testing purpose. |
| 67 bool IsArcOptInVerificationDisabled(); | 78 bool IsArcOptInVerificationDisabled(); |
| 68 | 79 |
| 69 // Returns true if the |window|'s aura::client::kAppType is ARC_APP. When | 80 // Returns true if the |window|'s aura::client::kAppType is ARC_APP. When |
| 70 // |window| is nullptr, returns false. | 81 // |window| is nullptr, returns false. |
| 71 bool IsArcAppWindow(aura::Window* window); | 82 bool IsArcAppWindow(aura::Window* window); |
| 72 | 83 |
| 73 } // namespace arc | 84 } // namespace arc |
| 74 | 85 |
| 75 #endif // COMPONENTS_ARC_ARC_UTIL_H_ | 86 #endif // COMPONENTS_ARC_ARC_UTIL_H_ |
| OLD | NEW |