| 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 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 if (logged_in_user == users_.end()) { | 373 if (logged_in_user == users_.end()) { |
| 374 is_current_user_new_ = true; | 374 is_current_user_new_ = true; |
| 375 logged_in_user_ = CreateUser(email); | 375 logged_in_user_ = CreateUser(email); |
| 376 } else { | 376 } else { |
| 377 logged_in_user_ = *logged_in_user; | 377 logged_in_user_ = *logged_in_user; |
| 378 users_.erase(logged_in_user); | 378 users_.erase(logged_in_user); |
| 379 } | 379 } |
| 380 // This user must be in the front of the user list. | 380 // This user must be in the front of the user list. |
| 381 users_.insert(users_.begin(), logged_in_user_); | 381 users_.insert(users_.begin(), logged_in_user_); |
| 382 | 382 |
| 383 NotifyOnLogin(); | |
| 384 | |
| 385 if (is_current_user_new_) { | 383 if (is_current_user_new_) { |
| 386 SetInitialUserImage(email); | 384 SetInitialUserImage(email); |
| 387 } else { | 385 } else { |
| 388 // Download profile image if it's user image and see if it has changed. | 386 // Download profile image if it's user image and see if it has changed. |
| 389 int image_index = logged_in_user_->image_index(); | 387 int image_index = logged_in_user_->image_index(); |
| 390 if (image_index == User::kProfileImageIndex) { | 388 if (image_index == User::kProfileImageIndex) { |
| 391 InitDownloadedProfileImage(); | 389 InitDownloadedProfileImage(); |
| 392 BrowserThread::PostDelayedTask( | 390 BrowserThread::PostDelayedTask( |
| 393 BrowserThread::UI, | 391 BrowserThread::UI, |
| 394 FROM_HERE, | 392 FROM_HERE, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 406 break; | 404 break; |
| 407 | 405 |
| 408 case User::kProfileImageIndex: | 406 case User::kProfileImageIndex: |
| 409 histogram_index = kHistogramImageFromProfile; | 407 histogram_index = kHistogramImageFromProfile; |
| 410 break; | 408 break; |
| 411 } | 409 } |
| 412 UMA_HISTOGRAM_ENUMERATION("UserImage.LoggedIn", | 410 UMA_HISTOGRAM_ENUMERATION("UserImage.LoggedIn", |
| 413 histogram_index, | 411 histogram_index, |
| 414 kHistogramImagesCount); | 412 kHistogramImagesCount); |
| 415 } | 413 } |
| 414 |
| 415 NotifyOnLogin(); |
| 416 } | 416 } |
| 417 | 417 |
| 418 void UserManagerImpl::DemoUserLoggedIn() { | 418 void UserManagerImpl::DemoUserLoggedIn() { |
| 419 is_current_user_new_ = true; | 419 is_current_user_new_ = true; |
| 420 is_current_user_ephemeral_ = true; | 420 is_current_user_ephemeral_ = true; |
| 421 logged_in_user_ = new User(kDemoUser, false); | 421 logged_in_user_ = new User(kDemoUser, false); |
| 422 SetInitialUserImage(kDemoUser); | 422 SetInitialUserImage(kDemoUser); |
| 423 NotifyOnLogin(); | 423 NotifyOnLogin(); |
| 424 } | 424 } |
| 425 | 425 |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 BrowserThread::PostTask( | 1257 BrowserThread::PostTask( |
| 1258 BrowserThread::FILE, | 1258 BrowserThread::FILE, |
| 1259 FROM_HERE, | 1259 FROM_HERE, |
| 1260 base::Bind(&UserManagerImpl::DeleteUserImage, | 1260 base::Bind(&UserManagerImpl::DeleteUserImage, |
| 1261 base::Unretained(this), | 1261 base::Unretained(this), |
| 1262 image_path)); | 1262 image_path)); |
| 1263 } | 1263 } |
| 1264 } | 1264 } |
| 1265 | 1265 |
| 1266 } // namespace chromeos | 1266 } // namespace chromeos |
| OLD | NEW |