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 #include "components/arc/arc_util.h" | 5 #include "components/arc/arc_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 } | 52 } |
53 | 53 |
54 // For transition, fallback to old flags. | 54 // For transition, fallback to old flags. |
55 // TODO(hidehiko): Remove this and clean up whole this function, when | 55 // TODO(hidehiko): Remove this and clean up whole this function, when |
56 // session_manager supports a new flag. | 56 // session_manager supports a new flag. |
57 return command_line->HasSwitch(chromeos::switches::kEnableArc) || | 57 return command_line->HasSwitch(chromeos::switches::kEnableArc) || |
58 (command_line->HasSwitch(chromeos::switches::kArcAvailable) && | 58 (command_line->HasSwitch(chromeos::switches::kArcAvailable) && |
59 base::FeatureList::IsEnabled(kEnableArcFeature)); | 59 base::FeatureList::IsEnabled(kEnableArcFeature)); |
60 } | 60 } |
61 | 61 |
| 62 bool ShouldAlwaysStartArc() { |
| 63 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 64 chromeos::switches::kAlwaysStartArc); |
| 65 } |
| 66 |
| 67 void SetAlwaysStartArcForTesting() { |
| 68 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 69 chromeos::switches::kAlwaysStartArc); |
| 70 } |
| 71 |
62 bool IsArcKioskAvailable() { | 72 bool IsArcKioskAvailable() { |
63 const auto* command_line = base::CommandLine::ForCurrentProcess(); | 73 const auto* command_line = base::CommandLine::ForCurrentProcess(); |
64 | 74 |
65 if (command_line->HasSwitch(chromeos::switches::kArcAvailability)) { | 75 if (command_line->HasSwitch(chromeos::switches::kArcAvailability)) { |
66 std::string value = | 76 std::string value = |
67 command_line->GetSwitchValueASCII(chromeos::switches::kArcAvailability); | 77 command_line->GetSwitchValueASCII(chromeos::switches::kArcAvailability); |
68 if (value == kAvailabilityInstalledOnlyKioskSupported) | 78 if (value == kAvailabilityInstalledOnlyKioskSupported) |
69 return true; | 79 return true; |
70 } | 80 } |
71 | 81 |
(...skipping 22 matching lines...) Expand all Loading... |
94 kAvailabilityOfficiallySupportedWithActiveDirectory; | 104 kAvailabilityOfficiallySupportedWithActiveDirectory; |
95 } | 105 } |
96 | 106 |
97 bool IsArcOptInVerificationDisabled() { | 107 bool IsArcOptInVerificationDisabled() { |
98 const auto* command_line = base::CommandLine::ForCurrentProcess(); | 108 const auto* command_line = base::CommandLine::ForCurrentProcess(); |
99 return command_line->HasSwitch( | 109 return command_line->HasSwitch( |
100 chromeos::switches::kDisableArcOptInVerification); | 110 chromeos::switches::kDisableArcOptInVerification); |
101 } | 111 } |
102 | 112 |
103 } // namespace arc | 113 } // namespace arc |
OLD | NEW |