Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(441)

Side by Side Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 9972004: Send login notification after initializing default user avatar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698