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/user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/user_manager_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
204 downloaded_profile_image_data_url_(chrome::kAboutBlankURL) { | 204 downloaded_profile_image_data_url_(chrome::kAboutBlankURL) { |
205 // If we're not running on ChromeOS, and are not showing the login manager | 205 // If we're not running on ChromeOS, and are not showing the login manager |
206 // or attempting a command line login? Then login the stub user. | 206 // or attempting a command line login? Then login the stub user. |
207 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 207 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
208 if (!base::chromeos::IsRunningOnChromeOS() && | 208 if (!base::chromeos::IsRunningOnChromeOS() && |
209 !command_line->HasSwitch(switches::kLoginManager) && | 209 !command_line->HasSwitch(switches::kLoginManager) && |
210 !command_line->HasSwitch(switches::kLoginPassword) && | 210 !command_line->HasSwitch(switches::kLoginPassword) && |
211 !command_line->HasSwitch(switches::kGuestSession)) { | 211 !command_line->HasSwitch(switches::kGuestSession)) { |
212 StubUserLoggedIn(); | 212 StubUserLoggedIn(); |
213 } | 213 } |
214 if (command_line->HasSwitch(switches::kStubUser)) | |
Nikita (slow)
2012/06/07 15:26:55
Please combine with condition above.
It makes sens
Ivan Korotkov
2012/06/09 14:19:01
I actually don't need this flag anymore, removed.
Nikita (slow)
2012/06/13 14:07:35
Actually we have a bug to support such flag.
| |
215 StubUserLoggedIn(); | |
214 | 216 |
215 MigrateWallpaperData(); | 217 MigrateWallpaperData(); |
216 | 218 |
217 registrar_.Add(this, chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED, | 219 registrar_.Add(this, chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED, |
218 content::NotificationService::AllSources()); | 220 content::NotificationService::AllSources()); |
219 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_ADDED, | 221 registrar_.Add(this, chrome::NOTIFICATION_PROFILE_ADDED, |
220 content::NotificationService::AllSources()); | 222 content::NotificationService::AllSources()); |
221 RetrieveTrustedDevicePolicies(); | 223 RetrieveTrustedDevicePolicies(); |
222 } | 224 } |
223 | 225 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
346 void UserManagerImpl::EphemeralUserLoggedIn(const std::string& email) { | 348 void UserManagerImpl::EphemeralUserLoggedIn(const std::string& email) { |
347 is_current_user_new_ = true; | 349 is_current_user_new_ = true; |
348 is_current_user_ephemeral_ = true; | 350 is_current_user_ephemeral_ = true; |
349 logged_in_user_ = CreateUser(email); | 351 logged_in_user_ = CreateUser(email); |
350 SetInitialUserImage(email); | 352 SetInitialUserImage(email); |
351 SetInitialUserWallpaper(email); | 353 SetInitialUserWallpaper(email); |
352 NotifyOnLogin(); | 354 NotifyOnLogin(); |
353 } | 355 } |
354 | 356 |
355 void UserManagerImpl::StubUserLoggedIn() { | 357 void UserManagerImpl::StubUserLoggedIn() { |
356 is_current_user_ephemeral_ = true; | |
357 logged_in_user_ = new User(kStubUser, false); | 358 logged_in_user_ = new User(kStubUser, false); |
358 logged_in_user_->SetImage(GetDefaultImage(kStubDefaultImageIndex), | 359 logged_in_user_->SetImage(GetDefaultImage(kStubDefaultImageIndex), |
359 kStubDefaultImageIndex); | 360 kStubDefaultImageIndex); |
360 } | 361 } |
361 | 362 |
362 void UserManagerImpl::SetLoggedInUserWallpaper() { | 363 void UserManagerImpl::SetLoggedInUserWallpaper() { |
363 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 364 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
364 | 365 |
365 if (!IsUserLoggedIn() || IsLoggedInAsStub()) { | 366 if (!IsUserLoggedIn() || IsLoggedInAsStub()) { |
366 ash::Shell::GetInstance()->desktop_background_controller()-> | 367 ash::Shell::GetInstance()->desktop_background_controller()-> |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1508 BrowserThread::PostTask( | 1509 BrowserThread::PostTask( |
1509 BrowserThread::FILE, | 1510 BrowserThread::FILE, |
1510 FROM_HERE, | 1511 FROM_HERE, |
1511 base::Bind(&UserManagerImpl::DeleteUserImage, | 1512 base::Bind(&UserManagerImpl::DeleteUserImage, |
1512 base::Unretained(this), | 1513 base::Unretained(this), |
1513 image_path)); | 1514 image_path)); |
1514 } | 1515 } |
1515 } | 1516 } |
1516 | 1517 |
1517 } // namespace chromeos | 1518 } // namespace chromeos |
OLD | NEW |