OLD | NEW |
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/ui/user_adding_screen.h" | 5 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/chromeos/login/helper.h" | 13 #include "chrome/browser/chromeos/login/helper.h" |
14 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 14 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
15 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 15 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
16 #include "components/session_manager/core/session_manager.h" | 16 #include "components/session_manager/core/session_manager.h" |
| 17 #include "components/user_manager/user_manager.h" |
17 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
18 #include "ui/gfx/size.h" | 19 #include "ui/gfx/size.h" |
19 | 20 |
20 namespace chromeos { | 21 namespace chromeos { |
21 | 22 |
22 namespace { | 23 namespace { |
23 | 24 |
24 class UserAddingScreenImpl : public UserAddingScreen { | 25 class UserAddingScreenImpl : public UserAddingScreen { |
25 public: | 26 public: |
26 virtual void Start() OVERRIDE; | 27 virtual void Start() OVERRIDE; |
(...skipping 30 matching lines...) Expand all Loading... |
57 } | 58 } |
58 | 59 |
59 void UserAddingScreenImpl::Cancel() { | 60 void UserAddingScreenImpl::Cancel() { |
60 CHECK(IsRunning()); | 61 CHECK(IsRunning()); |
61 | 62 |
62 // Make sure that system tray is enabled after this flow. | 63 // Make sure that system tray is enabled after this flow. |
63 ash::Shell::GetInstance()->GetPrimarySystemTray()->SetEnabled(true); | 64 ash::Shell::GetInstance()->GetPrimarySystemTray()->SetEnabled(true); |
64 display_host_->Finalize(); | 65 display_host_->Finalize(); |
65 | 66 |
66 // Reset wallpaper if cancel adding user from multiple user sign in page. | 67 // Reset wallpaper if cancel adding user from multiple user sign in page. |
67 if (UserManager::Get()->IsUserLoggedIn()) { | 68 if (user_manager::UserManager::Get()->IsUserLoggedIn()) { |
68 WallpaperManager::Get()->SetUserWallpaperDelayed( | 69 WallpaperManager::Get()->SetUserWallpaperDelayed( |
69 UserManager::Get()->GetActiveUser()->email()); | 70 user_manager::UserManager::Get()->GetActiveUser()->email()); |
70 } | 71 } |
71 } | 72 } |
72 | 73 |
73 bool UserAddingScreenImpl::IsRunning() { | 74 bool UserAddingScreenImpl::IsRunning() { |
74 return display_host_ != NULL; | 75 return display_host_ != NULL; |
75 } | 76 } |
76 | 77 |
77 void UserAddingScreenImpl::AddObserver(Observer* observer) { | 78 void UserAddingScreenImpl::AddObserver(Observer* observer) { |
78 observers_.AddObserver(observer); | 79 observers_.AddObserver(observer); |
79 } | 80 } |
(...skipping 27 matching lines...) Expand all Loading... |
107 | 108 |
108 UserAddingScreen::UserAddingScreen() {} | 109 UserAddingScreen::UserAddingScreen() {} |
109 UserAddingScreen::~UserAddingScreen() {} | 110 UserAddingScreen::~UserAddingScreen() {} |
110 | 111 |
111 UserAddingScreen* UserAddingScreen::Get() { | 112 UserAddingScreen* UserAddingScreen::Get() { |
112 return UserAddingScreenImpl::GetInstance(); | 113 return UserAddingScreenImpl::GetInstance(); |
113 } | 114 } |
114 | 115 |
115 } // namespace chromeos | 116 } // namespace chromeos |
116 | 117 |
OLD | NEW |