| 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/chromeos/login/screens/user_image_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/user_image_screen.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 | 59 |
| 60 // static | 60 // static |
| 61 UserImageScreen* UserImageScreen::Get(ScreenManager* manager) { | 61 UserImageScreen* UserImageScreen::Get(ScreenManager* manager) { |
| 62 return static_cast<UserImageScreen*>( | 62 return static_cast<UserImageScreen*>( |
| 63 manager->GetScreen(WizardController::kUserImageScreenName)); | 63 manager->GetScreen(WizardController::kUserImageScreenName)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 UserImageScreen::UserImageScreen(BaseScreenDelegate* base_screen_delegate, | 66 UserImageScreen::UserImageScreen(BaseScreenDelegate* base_screen_delegate, |
| 67 UserImageView* view) | 67 UserImageView* view) |
| 68 : UserImageModel(base_screen_delegate), | 68 : UserImageModel(base_screen_delegate), |
| 69 ImageRequest( | |
| 70 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI)), | |
| 71 view_(view), | 69 view_(view), |
| 72 accept_photo_after_decoding_(false), | 70 accept_photo_after_decoding_(false), |
| 73 selected_image_(user_manager::User::USER_IMAGE_INVALID), | 71 selected_image_(user_manager::User::USER_IMAGE_INVALID), |
| 74 is_screen_ready_(false), | 72 is_screen_ready_(false), |
| 75 user_has_selected_image_(false) { | 73 user_has_selected_image_(false) { |
| 76 if (view_) | 74 if (view_) |
| 77 view_->Bind(*this); | 75 view_->Bind(*this); |
| 78 notification_registrar_.Add(this, | 76 notification_registrar_.Add(this, |
| 79 chrome::NOTIFICATION_PROFILE_IMAGE_UPDATED, | 77 chrome::NOTIFICATION_PROFILE_IMAGE_UPDATED, |
| 80 content::NotificationService::AllSources()); | 78 content::NotificationService::AllSources()); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 336 |
| 339 void UserImageScreen::ExitScreen() { | 337 void UserImageScreen::ExitScreen() { |
| 340 policy_registrar_.reset(); | 338 policy_registrar_.reset(); |
| 341 sync_timer_.reset(); | 339 sync_timer_.reset(); |
| 342 if (UserImageSyncObserver* sync_observer = GetSyncObserver()) | 340 if (UserImageSyncObserver* sync_observer = GetSyncObserver()) |
| 343 sync_observer->RemoveObserver(this); | 341 sync_observer->RemoveObserver(this); |
| 344 Finish(BaseScreenDelegate::USER_IMAGE_SELECTED); | 342 Finish(BaseScreenDelegate::USER_IMAGE_SELECTED); |
| 345 } | 343 } |
| 346 | 344 |
| 347 } // namespace chromeos | 345 } // namespace chromeos |
| OLD | NEW |