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" | |
8 #include "ash/system/tray/system_tray.h" | |
9 #include "base/bind.h" | 7 #include "base/bind.h" |
10 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
11 #include "base/observer_list.h" | 9 #include "base/observer_list.h" |
12 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
13 #include "chrome/browser/chromeos/login/helper.h" | 11 #include "chrome/browser/chromeos/login/helper.h" |
14 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 12 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
15 #include "chrome/browser/chromeos/login/ui/user_adding_screen_input_methods_cont
roller.h" | 13 #include "chrome/browser/chromeos/login/ui/user_adding_screen_input_methods_cont
roller.h" |
16 #include "components/session_manager/core/session_manager.h" | 14 #include "components/session_manager/core/session_manager.h" |
17 #include "components/user_manager/user_manager.h" | 15 #include "components/user_manager/user_manager.h" |
18 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
19 #include "ui/gfx/size.h" | 17 #include "ui/gfx/size.h" |
20 | 18 |
21 #if !defined(USE_ATHENA) | 19 #if !defined(USE_ATHENA) |
| 20 #include "ash/shell.h" |
| 21 #include "ash/system/tray/system_tray.h" |
22 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 22 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
23 #endif | 23 #endif |
24 | 24 |
25 namespace chromeos { | 25 namespace chromeos { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 class UserAddingScreenImpl : public UserAddingScreen { | 29 class UserAddingScreenImpl : public UserAddingScreen { |
30 public: | 30 public: |
31 virtual void Start() override; | 31 virtual void Start() override; |
(...skipping 27 matching lines...) Expand all Loading... |
59 base::Unretained(this))); | 59 base::Unretained(this))); |
60 | 60 |
61 g_browser_process->platform_part()->SessionManager()->SetSessionState( | 61 g_browser_process->platform_part()->SessionManager()->SetSessionState( |
62 session_manager::SESSION_STATE_LOGIN_SECONDARY); | 62 session_manager::SESSION_STATE_LOGIN_SECONDARY); |
63 FOR_EACH_OBSERVER(Observer, observers_, OnUserAddingStarted()); | 63 FOR_EACH_OBSERVER(Observer, observers_, OnUserAddingStarted()); |
64 } | 64 } |
65 | 65 |
66 void UserAddingScreenImpl::Cancel() { | 66 void UserAddingScreenImpl::Cancel() { |
67 CHECK(IsRunning()); | 67 CHECK(IsRunning()); |
68 | 68 |
| 69 #if !defined(USE_ATHENA) |
69 // Make sure that system tray is enabled after this flow. | 70 // Make sure that system tray is enabled after this flow. |
70 ash::Shell::GetInstance()->GetPrimarySystemTray()->SetEnabled(true); | 71 ash::Shell::GetInstance()->GetPrimarySystemTray()->SetEnabled(true); |
| 72 #endif |
71 display_host_->Finalize(); | 73 display_host_->Finalize(); |
72 | 74 |
73 #if !defined(USE_ATHENA) | 75 #if !defined(USE_ATHENA) |
74 // Reset wallpaper if cancel adding user from multiple user sign in page. | 76 // Reset wallpaper if cancel adding user from multiple user sign in page. |
75 if (user_manager::UserManager::Get()->IsUserLoggedIn()) { | 77 if (user_manager::UserManager::Get()->IsUserLoggedIn()) { |
76 WallpaperManager::Get()->SetUserWallpaperDelayed( | 78 WallpaperManager::Get()->SetUserWallpaperDelayed( |
77 user_manager::UserManager::Get()->GetActiveUser()->email()); | 79 user_manager::UserManager::Get()->GetActiveUser()->email()); |
78 } | 80 } |
79 #endif | 81 #endif |
80 } | 82 } |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 118 |
117 UserAddingScreen::UserAddingScreen() {} | 119 UserAddingScreen::UserAddingScreen() {} |
118 UserAddingScreen::~UserAddingScreen() {} | 120 UserAddingScreen::~UserAddingScreen() {} |
119 | 121 |
120 UserAddingScreen* UserAddingScreen::Get() { | 122 UserAddingScreen* UserAddingScreen::Get() { |
121 return UserAddingScreenImpl::GetInstance(); | 123 return UserAddingScreenImpl::GetInstance(); |
122 } | 124 } |
123 | 125 |
124 } // namespace chromeos | 126 } // namespace chromeos |
125 | 127 |
OLD | NEW |