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/lock/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
11 #include "ash/audio/sounds.h" | 11 #include "ash/audio/sounds.h" |
12 #include "ash/desktop_background/desktop_background_controller.h" | 12 #include "ash/desktop_background/desktop_background_controller.h" |
13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
14 #include "ash/wm/lock_state_controller.h" | 14 #include "ash/wm/lock_state_controller.h" |
15 #include "ash/wm/window_state.h" | 15 #include "ash/wm/window_state.h" |
16 #include "ash/wm/window_util.h" | 16 #include "ash/wm/window_util.h" |
17 #include "ash/wm/wm_event.h" | 17 #include "ash/wm/wm_event.h" |
18 #include "base/bind.h" | 18 #include "base/bind.h" |
19 #include "base/command_line.h" | 19 #include "base/command_line.h" |
20 #include "base/lazy_instance.h" | 20 #include "base/lazy_instance.h" |
21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
22 #include "base/message_loop/message_loop.h" | 22 #include "base/message_loop/message_loop.h" |
23 #include "base/metrics/histogram.h" | 23 #include "base/metrics/histogram.h" |
24 #include "base/strings/string_number_conversions.h" | 24 #include "base/strings/string_number_conversions.h" |
25 #include "base/strings/string_util.h" | 25 #include "base/strings/string_util.h" |
26 #include "chrome/browser/chrome_notification_types.h" | 26 #include "chrome/browser/chrome_notification_types.h" |
27 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h" | 27 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h" |
28 #include "chrome/browser/chromeos/login/login_utils.h" | |
29 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 28 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
30 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" | 29 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio
n.h" |
31 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 30 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
32 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 31 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
33 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" | 32 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" |
34 #include "chrome/browser/lifetime/application_lifetime.h" | 33 #include "chrome/browser/lifetime/application_lifetime.h" |
35 #include "chrome/browser/signin/easy_unlock_service.h" | 34 #include "chrome/browser/signin/easy_unlock_service.h" |
36 #include "chrome/browser/signin/signin_manager_factory.h" | 35 #include "chrome/browser/signin/signin_manager_factory.h" |
37 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_provider.h" | 36 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_provider.h" |
38 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.h" | 37 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 static_cast<media::SoundsManager::SoundKey>( | 149 static_cast<media::SoundsManager::SoundKey>( |
151 chromeos::SOUND_LOCK))); | 150 chromeos::SOUND_LOCK))); |
152 } | 151 } |
153 | 152 |
154 void ScreenLocker::Init() { | 153 void ScreenLocker::Init() { |
155 input_method::InputMethodManager* imm = | 154 input_method::InputMethodManager* imm = |
156 input_method::InputMethodManager::Get(); | 155 input_method::InputMethodManager::Get(); |
157 saved_ime_state_ = imm->GetActiveIMEState(); | 156 saved_ime_state_ = imm->GetActiveIMEState(); |
158 imm->SetState(saved_ime_state_->Clone()); | 157 imm->SetState(saved_ime_state_->Clone()); |
159 | 158 |
160 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); | 159 authenticator_ = UserSessionManager::GetInstance()->CreateAuthenticator(this); |
161 extended_authenticator_ = ExtendedAuthenticator::Create(this); | 160 extended_authenticator_ = ExtendedAuthenticator::Create(this); |
162 delegate_.reset(new WebUIScreenLocker(this)); | 161 delegate_.reset(new WebUIScreenLocker(this)); |
163 delegate_->LockScreen(); | 162 delegate_->LockScreen(); |
164 | 163 |
165 // Ownership of |icon_image_source| is passed. | 164 // Ownership of |icon_image_source| is passed. |
166 screenlock_icon_provider_.reset(new ScreenlockIconProvider); | 165 screenlock_icon_provider_.reset(new ScreenlockIconProvider); |
167 ScreenlockIconSource* screenlock_icon_source = | 166 ScreenlockIconSource* screenlock_icon_source = |
168 new ScreenlockIconSource(screenlock_icon_provider_->AsWeakPtr()); | 167 new ScreenlockIconSource(screenlock_icon_provider_->AsWeakPtr()); |
169 content::URLDataSource::Add( | 168 content::URLDataSource::Add( |
170 GetAssociatedWebUI()->GetWebContents()->GetBrowserContext(), | 169 GetAssociatedWebUI()->GetWebContents()->GetBrowserContext(), |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 for (user_manager::UserList::const_iterator it = users_.begin(); | 502 for (user_manager::UserList::const_iterator it = users_.begin(); |
504 it != users_.end(); | 503 it != users_.end(); |
505 ++it) { | 504 ++it) { |
506 if ((*it)->email() == username) | 505 if ((*it)->email() == username) |
507 return true; | 506 return true; |
508 } | 507 } |
509 return false; | 508 return false; |
510 } | 509 } |
511 | 510 |
512 } // namespace chromeos | 511 } // namespace chromeos |
OLD | NEW |