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" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/message_loop/message_loop_proxy.h" | 14 #include "base/message_loop/message_loop_proxy.h" |
15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
16 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
17 #include "base/values.h" | 17 #include "base/values.h" |
18 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
19 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 19 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
20 #include "chrome/browser/chromeos/camera_presence_notifier.h" | 20 #include "chrome/browser/chromeos/camera_presence_notifier.h" |
21 #include "chrome/browser/chromeos/login/login_utils.h" | 21 #include "chrome/browser/chromeos/login/login_utils.h" |
22 #include "chrome/browser/chromeos/login/screens/screen_observer.h" | 22 #include "chrome/browser/chromeos/login/screens/screen_observer.h" |
23 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager.h" | 23 #include "chrome/browser/chromeos/login/users/avatar/user_image_manager.h" |
24 #include "chrome/browser/chromeos/login/users/user_manager.h" | 24 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
25 #include "chrome/browser/chromeos/login/wizard_controller.h" | 25 #include "chrome/browser/chromeos/login/wizard_controller.h" |
26 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 26 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
27 #include "chrome/browser/policy/profile_policy_connector.h" | 27 #include "chrome/browser/policy/profile_policy_connector.h" |
28 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 28 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
29 #include "chrome/browser/profiles/profile.h" | 29 #include "chrome/browser/profiles/profile.h" |
30 #include "chrome/common/url_constants.h" | 30 #include "chrome/common/url_constants.h" |
31 #include "components/policy/core/common/policy_map.h" | 31 #include "components/policy/core/common/policy_map.h" |
32 #include "components/policy/core/common/policy_namespace.h" | 32 #include "components/policy/core/common/policy_namespace.h" |
33 #include "components/policy/core/common/policy_service.h" | 33 #include "components/policy/core/common/policy_service.h" |
34 #include "components/user_manager/user.h" | 34 #include "components/user_manager/user.h" |
35 #include "components/user_manager/user_image/default_user_images.h" | 35 #include "components/user_manager/user_image/default_user_images.h" |
36 #include "components/user_manager/user_image/user_image.h" | 36 #include "components/user_manager/user_image/user_image.h" |
| 37 #include "components/user_manager/user_manager.h" |
37 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
38 #include "content/public/browser/notification_service.h" | 39 #include "content/public/browser/notification_service.h" |
39 #include "policy/policy_constants.h" | 40 #include "policy/policy_constants.h" |
40 #include "third_party/skia/include/core/SkBitmap.h" | 41 #include "third_party/skia/include/core/SkBitmap.h" |
41 #include "ui/base/webui/web_ui_util.h" | 42 #include "ui/base/webui/web_ui_util.h" |
42 #include "ui/gfx/image/image_skia.h" | 43 #include "ui/gfx/image/image_skia.h" |
43 | 44 |
44 using content::BrowserThread; | 45 using content::BrowserThread; |
45 | 46 |
46 namespace chromeos { | 47 namespace chromeos { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 ExitScreen(); | 213 ExitScreen(); |
213 } | 214 } |
214 | 215 |
215 | 216 |
216 void UserImageScreen::PrepareToShow() { | 217 void UserImageScreen::PrepareToShow() { |
217 if (actor_) | 218 if (actor_) |
218 actor_->PrepareToShow(); | 219 actor_->PrepareToShow(); |
219 } | 220 } |
220 | 221 |
221 const user_manager::User* UserImageScreen::GetUser() { | 222 const user_manager::User* UserImageScreen::GetUser() { |
222 return UserManager::Get()->GetLoggedInUser(); | 223 return user_manager::UserManager::Get()->GetLoggedInUser(); |
223 } | 224 } |
224 | 225 |
225 UserImageManager* UserImageScreen::GetUserImageManager() { | 226 UserImageManager* UserImageScreen::GetUserImageManager() { |
226 return UserManager::Get()->GetUserImageManager(GetUser()->email()); | 227 return ChromeUserManager::Get()->GetUserImageManager(GetUser()->email()); |
227 } | 228 } |
228 | 229 |
229 UserImageSyncObserver* UserImageScreen::GetSyncObserver() { | 230 UserImageSyncObserver* UserImageScreen::GetSyncObserver() { |
230 return GetUserImageManager()->GetSyncObserver(); | 231 return GetUserImageManager()->GetSyncObserver(); |
231 } | 232 } |
232 | 233 |
233 void UserImageScreen::Show() { | 234 void UserImageScreen::Show() { |
234 if (!actor_) | 235 if (!actor_) |
235 return; | 236 return; |
236 | 237 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 | 348 |
348 void UserImageScreen::ExitScreen() { | 349 void UserImageScreen::ExitScreen() { |
349 policy_registrar_.reset(); | 350 policy_registrar_.reset(); |
350 sync_timer_.reset(); | 351 sync_timer_.reset(); |
351 if (UserImageSyncObserver* sync_observer = GetSyncObserver()) | 352 if (UserImageSyncObserver* sync_observer = GetSyncObserver()) |
352 sync_observer->RemoveObserver(this); | 353 sync_observer->RemoveObserver(this); |
353 get_screen_observer()->OnExit(ScreenObserver::USER_IMAGE_SELECTED); | 354 get_screen_observer()->OnExit(ScreenObserver::USER_IMAGE_SELECTED); |
354 } | 355 } |
355 | 356 |
356 } // namespace chromeos | 357 } // namespace chromeos |
OLD | NEW |