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

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

Issue 2877883002: Consolidate two IsArcWindow functions to reduce code duplication (Closed)
Patch Set: Address a comment from sadrul@ 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"
9 #include "base/command_line.h" 10 #include "base/command_line.h"
10 #include "base/feature_list.h" 11 #include "base/feature_list.h"
11 #include "chromeos/chromeos_switches.h" 12 #include "chromeos/chromeos_switches.h"
12 #include "components/user_manager/user_manager.h" 13 #include "components/user_manager/user_manager.h"
14 #include "ui/aura/client/aura_constants.h"
15 #include "ui/aura/window.h"
13 16
14 namespace arc { 17 namespace arc {
15 18
16 namespace { 19 namespace {
17 20
18 // This is for finch. See also crbug.com/633704 for details. 21 // This is for finch. See also crbug.com/633704 for details.
19 // TODO(hidehiko): More comments of the intention how this works, when 22 // TODO(hidehiko): More comments of the intention how this works, when
20 // we unify the commandline flags. 23 // we unify the commandline flags.
21 const base::Feature kEnableArcFeature{"EnableARC", 24 const base::Feature kEnableArcFeature{"EnableARC",
22 base::FEATURE_DISABLED_BY_DEFAULT}; 25 base::FEATURE_DISABLED_BY_DEFAULT};
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 chromeos::switches::kArcAvailability) == 107 chromeos::switches::kArcAvailability) ==
105 kAvailabilityOfficiallySupportedWithActiveDirectory; 108 kAvailabilityOfficiallySupportedWithActiveDirectory;
106 } 109 }
107 110
108 bool IsArcOptInVerificationDisabled() { 111 bool IsArcOptInVerificationDisabled() {
109 const auto* command_line = base::CommandLine::ForCurrentProcess(); 112 const auto* command_line = base::CommandLine::ForCurrentProcess();
110 return command_line->HasSwitch( 113 return command_line->HasSwitch(
111 chromeos::switches::kDisableArcOptInVerification); 114 chromeos::switches::kDisableArcOptInVerification);
112 } 115 }
113 116
117 bool IsArcAppWindow(aura::Window* window) {
118 if (!window)
119 return false;
120 return window->GetProperty(aura::client::kAppType) ==
121 static_cast<int>(ash::AppType::ARC_APP);
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