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

Side by Side Diff: chrome/browser/chromeos/arc/arc_session_manager.cc

Issue 2621293002: ARC is not allowed for incognito profile. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/chromeos/arc/arc_session_manager.h" 5 #include "chrome/browser/chromeos/arc/arc_session_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/shelf/shelf_delegate.h" 9 #include "ash/common/shelf/shelf_delegate.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 if (!profile) { 156 if (!profile) {
157 VLOG(1) << "ARC is not supported for systems without profile."; 157 VLOG(1) << "ARC is not supported for systems without profile.";
158 return false; 158 return false;
159 } 159 }
160 160
161 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile)) { 161 if (!chromeos::ProfileHelper::IsPrimaryProfile(profile)) {
162 VLOG(1) << "Non-primary users are not supported in ARC."; 162 VLOG(1) << "Non-primary users are not supported in ARC.";
163 return false; 163 return false;
164 } 164 }
165 165
166 // IsPrimaryProfile can return true for an incognito profile corresponding
hidehiko 2017/01/11 14:29:42 Note: I'm not very sure if this is intentional beh
167 // to the primary profile, but ARC does not support it.
168 if (profile->IsOffTheRecord()) {
169 VLOG(1) << "Incognito profile is not supported in ARC.";
170 return false;
171 }
172
166 if (profile->IsLegacySupervised()) { 173 if (profile->IsLegacySupervised()) {
167 VLOG(1) << "Supervised users are not supported in ARC."; 174 VLOG(1) << "Supervised users are not supported in ARC.";
168 return false; 175 return false;
169 } 176 }
170 177
171 user_manager::User const* const user = 178 user_manager::User const* const user =
172 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); 179 chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
173 if ((!user || !user->HasGaiaAccount()) && !IsArcKioskMode()) { 180 if ((!user || !user->HasGaiaAccount()) && !IsArcKioskMode()) {
174 VLOG(1) << "Users without GAIA accounts are not supported in ARC."; 181 VLOG(1) << "Users without GAIA accounts are not supported in ARC.";
175 return false; 182 return false;
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
999 return os << "ACTIVE"; 1006 return os << "ACTIVE";
1000 } 1007 }
1001 1008
1002 // Some compiler reports an error even if all values of an enum-class are 1009 // Some compiler reports an error even if all values of an enum-class are
1003 // covered indivisually in a switch statement. 1010 // covered indivisually in a switch statement.
1004 NOTREACHED(); 1011 NOTREACHED();
1005 return os; 1012 return os;
1006 } 1013 }
1007 1014
1008 } // namespace arc 1015 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698