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

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

Issue 2513473006: Stop running arc container on supervised user creation flow (Closed)
Patch Set: rebased Created 4 years 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 | chrome/browser/chromeos/login/easy_unlock/bootstrap_user_flow.h » ('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 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"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/callback_helpers.h" 12 #include "base/callback_helpers.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "chrome/browser/chromeos/arc/arc_auth_code_fetcher.h" 17 #include "chrome/browser/chromeos/arc/arc_auth_code_fetcher.h"
18 #include "chrome/browser/chromeos/arc/arc_auth_context.h" 18 #include "chrome/browser/chromeos/arc/arc_auth_context.h"
19 #include "chrome/browser/chromeos/arc/arc_optin_uma.h" 19 #include "chrome/browser/chromeos/arc/arc_optin_uma.h"
20 #include "chrome/browser/chromeos/arc/arc_support_host.h" 20 #include "chrome/browser/chromeos/arc/arc_support_host.h"
21 #include "chrome/browser/chromeos/arc/auth/arc_robot_auth.h" 21 #include "chrome/browser/chromeos/arc/auth/arc_robot_auth.h"
22 #include "chrome/browser/chromeos/arc/optin/arc_terms_of_service_negotiator.h" 22 #include "chrome/browser/chromeos/arc/optin/arc_terms_of_service_negotiator.h"
23 #include "chrome/browser/chromeos/arc/policy/arc_android_management_checker.h" 23 #include "chrome/browser/chromeos/arc/policy/arc_android_management_checker.h"
24 #include "chrome/browser/chromeos/arc/policy/arc_policy_util.h" 24 #include "chrome/browser/chromeos/arc/policy/arc_policy_util.h"
25 #include "chrome/browser/chromeos/login/user_flow.h"
26 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h"
25 #include "chrome/browser/chromeos/profiles/profile_helper.h" 27 #include "chrome/browser/chromeos/profiles/profile_helper.h"
26 #include "chrome/browser/lifetime/application_lifetime.h" 28 #include "chrome/browser/lifetime/application_lifetime.h"
27 #include "chrome/browser/policy/profile_policy_connector.h" 29 #include "chrome/browser/policy/profile_policy_connector.h"
28 #include "chrome/browser/policy/profile_policy_connector_factory.h" 30 #include "chrome/browser/policy/profile_policy_connector_factory.h"
29 #include "chrome/browser/prefs/pref_service_syncable_util.h" 31 #include "chrome/browser/prefs/pref_service_syncable_util.h"
30 #include "chrome/browser/profiles/profile.h" 32 #include "chrome/browser/profiles/profile.h"
31 #include "chrome/browser/ui/app_list/arc/arc_app_launcher.h" 33 #include "chrome/browser/ui/app_list/arc/arc_app_launcher.h"
32 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" 34 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
33 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" 35 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
34 #include "chrome/browser/ui/browser_commands.h" 36 #include "chrome/browser/ui/browser_commands.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 return false; 163 return false;
162 } 164 }
163 165
164 user_manager::User const* const user = 166 user_manager::User const* const user =
165 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); 167 chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
166 if ((!user || !user->HasGaiaAccount()) && !IsArcKioskMode()) { 168 if ((!user || !user->HasGaiaAccount()) && !IsArcKioskMode()) {
167 VLOG(1) << "Users without GAIA accounts are not supported in ARC."; 169 VLOG(1) << "Users without GAIA accounts are not supported in ARC.";
168 return false; 170 return false;
169 } 171 }
170 172
173 chromeos::UserFlow* user_flow =
174 chromeos::ChromeUserManager::Get()->GetUserFlow(user->GetAccountId());
175 if (!user_flow || !user_flow->CanStartArc()) {
176 VLOG(1) << "ARC is not allowed in the current user flow.";
177 return false;
178 }
179
171 if (user_manager::UserManager::Get() 180 if (user_manager::UserManager::Get()
172 ->IsCurrentUserCryptohomeDataEphemeral()) { 181 ->IsCurrentUserCryptohomeDataEphemeral()) {
173 VLOG(2) << "Users with ephemeral data are not supported in Arc."; 182 VLOG(2) << "Users with ephemeral data are not supported in Arc.";
174 return false; 183 return false;
175 } 184 }
176 185
177 return true; 186 return true;
178 } 187 }
179 188
180 // static 189 // static
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 return os << "ACTIVE"; 847 return os << "ACTIVE";
839 } 848 }
840 849
841 // Some compiler reports an error even if all values of an enum-class are 850 // Some compiler reports an error even if all values of an enum-class are
842 // covered indivisually in a switch statement. 851 // covered indivisually in a switch statement.
843 NOTREACHED(); 852 NOTREACHED();
844 return os; 853 return os;
845 } 854 }
846 855
847 } // namespace arc 856 } // namespace arc
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/easy_unlock/bootstrap_user_flow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698