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

Side by Side Diff: chrome/browser/chromeos/login/users/avatar/user_image_sync_observer.cc

Issue 539483002: Move all typecasting code to individual screens. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes Created 6 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/users/avatar/user_image_sync_observer.h" 5 #include "chrome/browser/chromeos/login/users/avatar/user_image_sync_observer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/prefs/pref_change_registrar.h" 8 #include "base/prefs/pref_change_registrar.h"
9 #include "base/prefs/scoped_user_pref_update.h" 9 #include "base/prefs/scoped_user_pref_update.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 bool UserImageSyncObserver::GetSyncedImageIndex(int* index) { 182 bool UserImageSyncObserver::GetSyncedImageIndex(int* index) {
183 *index = user_manager::User::USER_IMAGE_INVALID; 183 *index = user_manager::User::USER_IMAGE_INVALID;
184 const base::DictionaryValue* dict = prefs_->GetDictionary(kUserImageInfo); 184 const base::DictionaryValue* dict = prefs_->GetDictionary(kUserImageInfo);
185 return dict && dict->GetInteger(kImageIndex, index); 185 return dict && dict->GetInteger(kImageIndex, index);
186 } 186 }
187 187
188 bool UserImageSyncObserver::CanUpdateLocalImageNow() { 188 bool UserImageSyncObserver::CanUpdateLocalImageNow() {
189 if (WizardController* wizard_controller = 189 if (WizardController* wizard_controller =
190 WizardController::default_controller()) { 190 WizardController::default_controller()) {
191 UserImageScreen* screen = wizard_controller->GetUserImageScreen(); 191 UserImageScreen* screen = UserImageScreen::Get(wizard_controller);
192 if (wizard_controller->current_screen() == screen) { 192 if (wizard_controller->current_screen() == screen) {
193 if (screen->user_selected_image()) 193 if (screen->user_selected_image())
194 return false; 194 return false;
195 } 195 }
196 } 196 }
197 return true; 197 return true;
198 } 198 }
199 199
200 } // namespace chromeos 200 } // namespace chromeos
201 201
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698