OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/login/login_utils.h" | 5 #include "chrome/browser/chromeos/login/login_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 return user_flags; | 101 return user_flags; |
102 } | 102 } |
103 | 103 |
104 // Returns true if restart is needed to apply per-session flags. | 104 // Returns true if restart is needed to apply per-session flags. |
105 bool NeedRestartToApplyPerSessionFlags(const CommandLine& user_flags) { | 105 bool NeedRestartToApplyPerSessionFlags(const CommandLine& user_flags) { |
106 // Don't restart browser if it is not first profile in session. | 106 // Don't restart browser if it is not first profile in session. |
107 if (UserManager::Get()->GetLoggedInUsers().size() != 1) | 107 if (UserManager::Get()->GetLoggedInUsers().size() != 1) |
108 return false; | 108 return false; |
109 | 109 |
110 // Only restart if needed and if not going into managed mode. | 110 // Only restart if needed and if not going into managed mode. |
111 if (UserManager::Get()->IsLoggedInAsLocallyManagedUser()) | 111 if (UserManager::Get()->IsLoggedInAsSupervisedUser()) |
112 return false; | 112 return false; |
113 | 113 |
114 if (about_flags::AreSwitchesIdenticalToCurrentCommandLine( | 114 if (about_flags::AreSwitchesIdenticalToCurrentCommandLine( |
115 user_flags, *CommandLine::ForCurrentProcess())) { | 115 user_flags, *CommandLine::ForCurrentProcess())) { |
116 return false; | 116 return false; |
117 } | 117 } |
118 | 118 |
119 return true; | 119 return true; |
120 } | 120 } |
121 | 121 |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 CrosSettings* cros_settings = CrosSettings::Get(); | 458 CrosSettings* cros_settings = CrosSettings::Get(); |
459 bool allow_new_user = false; | 459 bool allow_new_user = false; |
460 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 460 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
461 if (allow_new_user) | 461 if (allow_new_user) |
462 return true; | 462 return true; |
463 return cros_settings->FindEmailInList( | 463 return cros_settings->FindEmailInList( |
464 kAccountsPrefUsers, username, wildcard_match); | 464 kAccountsPrefUsers, username, wildcard_match); |
465 } | 465 } |
466 | 466 |
467 } // namespace chromeos | 467 } // namespace chromeos |
OLD | NEW |