| 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/ui/user_adding_screen_input_methods_cont
roller.h" |
| 15 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 16 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| 16 #include "components/session_manager/core/session_manager.h" | 17 #include "components/session_manager/core/session_manager.h" |
| 17 #include "components/user_manager/user_manager.h" | 18 #include "components/user_manager/user_manager.h" |
| 18 #include "ui/gfx/rect.h" | 19 #include "ui/gfx/rect.h" |
| 19 #include "ui/gfx/size.h" | 20 #include "ui/gfx/size.h" |
| 20 | 21 |
| 21 namespace chromeos { | 22 namespace chromeos { |
| 22 | 23 |
| 23 namespace { | 24 namespace { |
| 24 | 25 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 35 private: | 36 private: |
| 36 friend struct DefaultSingletonTraits<UserAddingScreenImpl>; | 37 friend struct DefaultSingletonTraits<UserAddingScreenImpl>; |
| 37 | 38 |
| 38 void OnDisplayHostCompletion(); | 39 void OnDisplayHostCompletion(); |
| 39 | 40 |
| 40 UserAddingScreenImpl(); | 41 UserAddingScreenImpl(); |
| 41 virtual ~UserAddingScreenImpl(); | 42 virtual ~UserAddingScreenImpl(); |
| 42 | 43 |
| 43 ObserverList<Observer> observers_; | 44 ObserverList<Observer> observers_; |
| 44 LoginDisplayHost* display_host_; | 45 LoginDisplayHost* display_host_; |
| 46 |
| 47 UserAddingScreenInputMethodsController im_controller_; |
| 45 }; | 48 }; |
| 46 | 49 |
| 47 void UserAddingScreenImpl::Start() { | 50 void UserAddingScreenImpl::Start() { |
| 48 CHECK(!IsRunning()); | 51 CHECK(!IsRunning()); |
| 49 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); | 52 gfx::Rect screen_bounds(chromeos::CalculateScreenBounds(gfx::Size())); |
| 50 display_host_ = new chromeos::LoginDisplayHostImpl(screen_bounds); | 53 display_host_ = new chromeos::LoginDisplayHostImpl(screen_bounds); |
| 51 display_host_->StartUserAdding( | 54 display_host_->StartUserAdding( |
| 52 base::Bind(&UserAddingScreenImpl::OnDisplayHostCompletion, | 55 base::Bind(&UserAddingScreenImpl::OnDisplayHostCompletion, |
| 53 base::Unretained(this))); | 56 base::Unretained(this))); |
| 54 | 57 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 session_manager::SESSION_STATE_ACTIVE); | 94 session_manager::SESSION_STATE_ACTIVE); |
| 92 FOR_EACH_OBSERVER(Observer, observers_, OnUserAddingFinished()); | 95 FOR_EACH_OBSERVER(Observer, observers_, OnUserAddingFinished()); |
| 93 } | 96 } |
| 94 | 97 |
| 95 // static | 98 // static |
| 96 UserAddingScreenImpl* UserAddingScreenImpl::GetInstance() { | 99 UserAddingScreenImpl* UserAddingScreenImpl::GetInstance() { |
| 97 return Singleton<UserAddingScreenImpl>::get(); | 100 return Singleton<UserAddingScreenImpl>::get(); |
| 98 } | 101 } |
| 99 | 102 |
| 100 UserAddingScreenImpl::UserAddingScreenImpl() | 103 UserAddingScreenImpl::UserAddingScreenImpl() |
| 101 : display_host_(NULL) { | 104 : display_host_(NULL), im_controller_(this) { |
| 102 } | 105 } |
| 103 | 106 |
| 104 UserAddingScreenImpl::~UserAddingScreenImpl() { | 107 UserAddingScreenImpl::~UserAddingScreenImpl() { |
| 105 } | 108 } |
| 106 | 109 |
| 107 } // anonymous namespace | 110 } // anonymous namespace |
| 108 | 111 |
| 109 UserAddingScreen::UserAddingScreen() {} | 112 UserAddingScreen::UserAddingScreen() {} |
| 110 UserAddingScreen::~UserAddingScreen() {} | 113 UserAddingScreen::~UserAddingScreen() {} |
| 111 | 114 |
| 112 UserAddingScreen* UserAddingScreen::Get() { | 115 UserAddingScreen* UserAddingScreen::Get() { |
| 113 return UserAddingScreenImpl::GetInstance(); | 116 return UserAddingScreenImpl::GetInstance(); |
| 114 } | 117 } |
| 115 | 118 |
| 116 } // namespace chromeos | 119 } // namespace chromeos |
| 117 | 120 |
| OLD | NEW |