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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 LoginDisplayHost* login_host) { | 209 LoginDisplayHost* login_host) { |
210 if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) { | 210 if (!UserManager::Get()->GetCurrentUserFlow()->ShouldLaunchBrowser()) { |
211 UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile); | 211 UserManager::Get()->GetCurrentUserFlow()->LaunchExtraSteps(profile); |
212 return; | 212 return; |
213 } | 213 } |
214 | 214 |
215 CommandLine user_flags(CommandLine::NO_PROGRAM); | 215 CommandLine user_flags(CommandLine::NO_PROGRAM); |
216 about_flags::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); | 216 about_flags::PrefServiceFlagsStorage flags_storage_(profile->GetPrefs()); |
217 about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags, | 217 about_flags::ConvertFlagsToSwitches(&flags_storage_, &user_flags, |
218 about_flags::kAddSentinels); | 218 about_flags::kAddSentinels); |
| 219 |
| 220 std::set<CommandLine::StringType> command_line_difference; |
| 221 |
219 // Only restart if needed and if not going into managed mode. | 222 // Only restart if needed and if not going into managed mode. |
220 // Don't restart browser if it is not first profile in session. | 223 // Don't restart browser if it is not first profile in session. |
221 if (UserManager::Get()->GetLoggedInUsers().size() == 1 && | 224 if (UserManager::Get()->GetLoggedInUsers().size() == 1 && |
222 !UserManager::Get()->IsLoggedInAsLocallyManagedUser() && | 225 !UserManager::Get()->IsLoggedInAsLocallyManagedUser() && |
223 !about_flags::AreSwitchesIdenticalToCurrentCommandLine( | 226 !about_flags::AreSwitchesIdenticalToCurrentCommandLine( |
224 user_flags, *CommandLine::ForCurrentProcess())) { | 227 user_flags, |
| 228 *CommandLine::ForCurrentProcess(), |
| 229 &command_line_difference)) { |
225 CommandLine::StringVector flags; | 230 CommandLine::StringVector flags; |
226 // argv[0] is the program name |CommandLine::NO_PROGRAM|. | 231 // argv[0] is the program name |CommandLine::NO_PROGRAM|. |
227 flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); | 232 flags.assign(user_flags.argv().begin() + 1, user_flags.argv().end()); |
228 VLOG(1) << "Restarting to apply per-session flags..."; | 233 VLOG(1) << "Restarting to apply per-session flags..."; |
| 234 |
| 235 about_flags::ReportCustomFlags("Login.CustomFlags", |
| 236 command_line_difference); |
| 237 |
229 DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( | 238 DBusThreadManager::Get()->GetSessionManagerClient()->SetFlagsForUser( |
230 UserManager::Get()->GetActiveUser()->email(), flags); | 239 UserManager::Get()->GetActiveUser()->email(), flags); |
231 AttemptRestart(profile); | 240 AttemptRestart(profile); |
232 return; | 241 return; |
233 } | 242 } |
234 | 243 |
235 if (login_host) { | 244 if (login_host) { |
236 login_host->SetStatusAreaVisible(true); | 245 login_host->SetStatusAreaVisible(true); |
237 login_host->BeforeSessionStart(); | 246 login_host->BeforeSessionStart(); |
238 } | 247 } |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 CrosSettings* cros_settings = CrosSettings::Get(); | 409 CrosSettings* cros_settings = CrosSettings::Get(); |
401 bool allow_new_user = false; | 410 bool allow_new_user = false; |
402 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); | 411 cros_settings->GetBoolean(kAccountsPrefAllowNewUser, &allow_new_user); |
403 if (allow_new_user) | 412 if (allow_new_user) |
404 return true; | 413 return true; |
405 return cros_settings->FindEmailInList( | 414 return cros_settings->FindEmailInList( |
406 kAccountsPrefUsers, username, wildcard_match); | 415 kAccountsPrefUsers, username, wildcard_match); |
407 } | 416 } |
408 | 417 |
409 } // namespace chromeos | 418 } // namespace chromeos |
OLD | NEW |