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

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

Issue 2877883002: Consolidate two IsArcWindow functions to reduce code duplication (Closed)
Patch Set: address comments from Luis 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
« no previous file with comments | « components/arc/arc_util.h ('k') | components/arc/arc_util_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
OLDNEW
« no previous file with comments | « components/arc/arc_util.h ('k') | components/arc/arc_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698