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

Side by Side Diff: chrome/browser/automation/automation_provider_observers_chromeos.cc

Issue 10830111: [cros] Encode user images when set from WebUI (regression fix). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes Created 8 years, 4 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
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/automation/automation_provider_observers.h" 5 #include "chrome/browser/automation/automation_provider_observers.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/automation/automation_provider.h" 8 #include "chrome/browser/automation/automation_provider.h"
9 #include "chrome/browser/chromeos/cros/cros_library.h" 9 #include "chrome/browser/chromeos/cros/cros_library.h"
10 #include "chrome/browser/chromeos/login/authentication_notification_details.h" 10 #include "chrome/browser/chromeos/login/authentication_notification_details.h"
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 AutomationJSONReply( 511 AutomationJSONReply(
512 automation_, 512 automation_,
513 reply_message_.release()).SendError("User email is not set"); 513 reply_message_.release()).SendError("User email is not set");
514 } 514 }
515 delete this; 515 delete this;
516 return; 516 return;
517 } 517 }
518 518
519 // Set up an observer for UserManager (it will delete itself). 519 // Set up an observer for UserManager (it will delete itself).
520 user_manager->AddObserver(this); 520 user_manager->AddObserver(this);
521 user_manager->SaveUserImage(user.email(), chromeos::UserImage(photo)); 521 user_manager->SaveUserImage(
522 user.email(), chromeos::UserImage::CreateAndEncode(photo));
522 } 523 }
523 524
524 void PhotoCaptureObserver::LocalStateChanged( 525 void PhotoCaptureObserver::LocalStateChanged(
525 chromeos::UserManager* user_manager) { 526 chromeos::UserManager* user_manager) {
526 user_manager->RemoveObserver(this); 527 user_manager->RemoveObserver(this);
527 if (automation_) { 528 if (automation_) {
528 AutomationJSONReply( 529 AutomationJSONReply(
529 automation_, reply_message_.release()).SendSuccess(NULL); 530 automation_, reply_message_.release()).SendSuccess(NULL);
530 } 531 }
531 delete this; 532 delete this;
532 } 533 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/user.h » ('j') | chrome/browser/chromeos/login/user_image.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698