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 "ash/shared/app_types.h" | |
10 #include "ash/wm_window.h" | |
9 #include "base/command_line.h" | 11 #include "base/command_line.h" |
10 #include "base/feature_list.h" | 12 #include "base/feature_list.h" |
11 #include "chromeos/chromeos_switches.h" | 13 #include "chromeos/chromeos_switches.h" |
12 #include "components/user_manager/user_manager.h" | 14 #include "components/user_manager/user_manager.h" |
13 | 15 |
14 namespace arc { | 16 namespace arc { |
15 | 17 |
16 namespace { | 18 namespace { |
17 | 19 |
18 // This is for finch. See also crbug.com/633704 for details. | 20 // This is for finch. See also crbug.com/633704 for details. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 chromeos::switches::kArcAvailability) == | 106 chromeos::switches::kArcAvailability) == |
105 kAvailabilityOfficiallySupportedWithActiveDirectory; | 107 kAvailabilityOfficiallySupportedWithActiveDirectory; |
106 } | 108 } |
107 | 109 |
108 bool IsArcOptInVerificationDisabled() { | 110 bool IsArcOptInVerificationDisabled() { |
109 const auto* command_line = base::CommandLine::ForCurrentProcess(); | 111 const auto* command_line = base::CommandLine::ForCurrentProcess(); |
110 return command_line->HasSwitch( | 112 return command_line->HasSwitch( |
111 chromeos::switches::kDisableArcOptInVerification); | 113 chromeos::switches::kDisableArcOptInVerification); |
112 } | 114 } |
113 | 115 |
116 bool IsArcAppWindow(aura::Window* window) { | |
117 // The getter returns nullptr when |window| is nullptr. | |
118 ash::WmWindow* wm_window = ash::WmWindow::Get(window); | |
119 if (!wm_window) | |
120 return false; | |
121 return wm_window->GetAppType() == static_cast<int>(ash::AppType::ARC_APP); | |
oshima
2017/05/13 01:06:09
Could you please use GetProperty(aura::client::kAp
Yusuke Sato
2017/05/15 21:57:50
Done.
| |
122 } | |
123 | |
114 } // namespace arc | 124 } // namespace arc |
OLD | NEW |