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

Side by Side Diff: chrome/browser/ui/webui/settings/chromeos/change_picture_handler.cc

Issue 2471993002: Remove calls to User::email() from chrome/browser/ui/webui/* (Closed)
Patch Set: Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/ui/webui/settings/chromeos/change_picture_handler.h" 5 #include "chrome/browser/ui/webui/settings/chromeos/change_picture_handler.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 if (!camera_observer_.IsObserving(camera)) 208 if (!camera_observer_.IsObserving(camera))
209 camera_observer_.Add(camera); 209 camera_observer_.Add(camera);
210 210
211 SendDefaultImages(); 211 SendDefaultImages();
212 SendSelectedImage(); 212 SendSelectedImage();
213 UpdateProfileImage(); 213 UpdateProfileImage();
214 } 214 }
215 215
216 void ChangePictureHandler::SendSelectedImage() { 216 void ChangePictureHandler::SendSelectedImage() {
217 const user_manager::User* user = GetUser(); 217 const user_manager::User* user = GetUser();
218 DCHECK(!user->email().empty()); 218 DCHECK(user->GetAccountId().is_valid());
219 219
220 previous_image_index_ = user->image_index(); 220 previous_image_index_ = user->image_index();
221 switch (previous_image_index_) { 221 switch (previous_image_index_) {
222 case user_manager::User::USER_IMAGE_EXTERNAL: { 222 case user_manager::User::USER_IMAGE_EXTERNAL: {
223 // User has image from camera/file, record it and add to the image list. 223 // User has image from camera/file, record it and add to the image list.
224 previous_image_ = user->GetImage(); 224 previous_image_ = user->GetImage();
225 SendOldImage(webui::GetBitmapDataUrl(*previous_image_.bitmap())); 225 SendOldImage(webui::GetBitmapDataUrl(*previous_image_.bitmap()));
226 break; 226 break;
227 } 227 }
228 case user_manager::User::USER_IMAGE_PROFILE: { 228 case user_manager::User::USER_IMAGE_PROFILE: {
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 Profile* profile = Profile::FromWebUI(web_ui()); 414 Profile* profile = Profile::FromWebUI(web_ui());
415 const user_manager::User* user = 415 const user_manager::User* user =
416 ProfileHelper::Get()->GetUserByProfile(profile); 416 ProfileHelper::Get()->GetUserByProfile(profile);
417 if (!user) 417 if (!user)
418 return user_manager::UserManager::Get()->GetActiveUser(); 418 return user_manager::UserManager::Get()->GetActiveUser();
419 return user; 419 return user;
420 } 420 }
421 421
422 } // namespace settings 422 } // namespace settings
423 } // namespace chromeos 423 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698