Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_optin_preference_handler.h" | 22 #include "chrome/browser/chromeos/arc/optin/arc_optin_preference_handler.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 Loading... | |
| 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()); | |
|
hidehiko
2016/11/22 03:34:48
Is there a case where user_flow is nullptr even in
yoshiki
2016/11/29 18:08:44
Done.
| |
| 175 if (user_flow && !user_flow->CanStartArc()) { | |
| 176 VLOG(1) << "ARC is prohibited in the currenet user flow."; | |
|
Luis Héctor Chávez
2016/11/22 19:12:14
nit: s/currenet/current/. also, consider changing
yoshiki
2016/11/29 18:08:44
Done.
| |
| 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 826 return os << "ACTIVE"; | 835 return os << "ACTIVE"; |
| 827 } | 836 } |
| 828 | 837 |
| 829 // Some compiler reports an error even if all values of an enum-class are | 838 // Some compiler reports an error even if all values of an enum-class are |
| 830 // covered indivisually in a switch statement. | 839 // covered indivisually in a switch statement. |
| 831 NOTREACHED(); | 840 NOTREACHED(); |
| 832 return os; | 841 return os; |
| 833 } | 842 } |
| 834 | 843 |
| 835 } // namespace arc | 844 } // namespace arc |
| OLD | NEW |