OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/browser/app_mode/app_mode_utils.h" | 5 #include "chrome/browser/app_mode/app_mode_utils.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 27 matching lines...) Expand all Loading... | |
38 if (kAllowed[i] == command_id) | 38 if (kAllowed[i] == command_id) |
39 return true; | 39 return true; |
40 } | 40 } |
41 | 41 |
42 return false; | 42 return false; |
43 } | 43 } |
44 | 44 |
45 bool IsRunningInAppMode() { | 45 bool IsRunningInAppMode() { |
46 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 46 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
47 return command_line->HasSwitch(switches::kKioskMode) || | 47 return command_line->HasSwitch(switches::kKioskMode) || |
48 IsRunningInForcedAppMode(); | 48 IsRunningInForcedAppMode(); |
Luis Héctor Chávez
2016/11/12 18:03:08
Do you also want this to include IsRunningInAndroi
Sergey Poromov
2016/11/14 17:23:22
Done. But I'll wait for xiyuan@ review to tell whe
xiyuan
2016/11/15 16:56:25
Yep, think we should include arc app. We should tr
| |
49 } | 49 } |
50 | 50 |
51 bool IsRunningInForcedAppMode() { | 51 bool IsRunningInForcedAppMode() { |
52 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 52 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
53 return command_line->HasSwitch(switches::kForceAppMode) && | 53 return command_line->HasSwitch(switches::kForceAppMode) && |
54 command_line->HasSwitch(switches::kAppId); | 54 command_line->HasSwitch(switches::kAppId); |
55 } | 55 } |
56 | 56 |
57 bool IsRunningInAndroidAppMode() { | |
hidehiko
2016/11/14 05:29:24
Considering the name consistency, IsRunningInForce
Sergey Poromov
2016/11/14 17:23:22
Done.
| |
58 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
peletskyi
2016/11/12 16:52:17
Can you try here to check what type of user is log
| |
59 return command_line->HasSwitch(switches::kForceAndroidAppMode); | |
hidehiko
2016/11/14 05:29:24
"command_line->HasSwitch(switches::kAppId)" is in
Sergey Poromov
2016/11/14 17:23:22
For android app we don't put the switch.
| |
60 } | |
61 | |
57 } // namespace chrome | 62 } // namespace chrome |
OLD | NEW |