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/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 Loading... |
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 } |
OLD | NEW |