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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 user_id_ = user_id; | 240 user_id_ = user_id; |
240 } | 241 } |
241 | 242 |
242 void UserImageScreen::PrepareToShow() { | 243 void UserImageScreen::PrepareToShow() { |
243 if (actor_) | 244 if (actor_) |
244 actor_->PrepareToShow(); | 245 actor_->PrepareToShow(); |
245 } | 246 } |
246 | 247 |
247 const user_manager::User* UserImageScreen::GetUser() { | 248 const user_manager::User* UserImageScreen::GetUser() { |
248 if (user_id_.empty()) | 249 if (user_id_.empty()) |
249 return UserManager::Get()->GetLoggedInUser(); | 250 return user_manager::UserManager::Get()->GetLoggedInUser(); |
250 return UserManager::Get()->FindUser(user_id_); | 251 return user_manager::UserManager::Get()->FindUser(user_id_); |
251 } | 252 } |
252 | 253 |
253 UserImageManager* UserImageScreen::GetUserImageManager() { | 254 UserImageManager* UserImageScreen::GetUserImageManager() { |
254 return UserManager::Get()->GetUserImageManager(GetUser()->email()); | 255 return ChromeUserManager::Get()->GetUserImageManager(GetUser()->email()); |
255 } | 256 } |
256 | 257 |
257 UserImageSyncObserver* UserImageScreen::GetSyncObserver() { | 258 UserImageSyncObserver* UserImageScreen::GetSyncObserver() { |
258 return GetUserImageManager()->GetSyncObserver(); | 259 return GetUserImageManager()->GetSyncObserver(); |
259 } | 260 } |
260 | 261 |
261 void UserImageScreen::Show() { | 262 void UserImageScreen::Show() { |
262 if (!actor_) | 263 if (!actor_) |
263 return; | 264 return; |
264 | 265 |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 | 380 |
380 void UserImageScreen::ExitScreen() { | 381 void UserImageScreen::ExitScreen() { |
381 policy_registrar_.reset(); | 382 policy_registrar_.reset(); |
382 sync_timer_.reset(); | 383 sync_timer_.reset(); |
383 if (UserImageSyncObserver* sync_observer = GetSyncObserver()) | 384 if (UserImageSyncObserver* sync_observer = GetSyncObserver()) |
384 sync_observer->RemoveObserver(this); | 385 sync_observer->RemoveObserver(this); |
385 get_screen_observer()->OnExit(ScreenObserver::USER_IMAGE_SELECTED); | 386 get_screen_observer()->OnExit(ScreenObserver::USER_IMAGE_SELECTED); |
386 } | 387 } |
387 | 388 |
388 } // namespace chromeos | 389 } // namespace chromeos |
OLD | NEW |