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/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/screen_locker.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/desktop_background/desktop_background_controller.h" | |
11 #include "ash/shell.h" | |
10 #include "base/bind.h" | 12 #include "base/bind.h" |
11 #include "base/command_line.h" | 13 #include "base/command_line.h" |
12 #include "base/lazy_instance.h" | 14 #include "base/lazy_instance.h" |
13 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
14 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
15 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
16 #include "base/string_util.h" | 18 #include "base/string_util.h" |
17 #include "base/timer.h" | 19 #include "base/timer.h" |
18 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
19 #include "chrome/browser/chromeos/login/authenticator.h" | 21 #include "chrome/browser/chromeos/login/authenticator.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 start_time_(base::Time::Now()), | 138 start_time_(base::Time::Now()), |
137 login_status_consumer_(NULL), | 139 login_status_consumer_(NULL), |
138 incorrect_passwords_count_(0) { | 140 incorrect_passwords_count_(0) { |
139 DCHECK(!screen_locker_); | 141 DCHECK(!screen_locker_); |
140 screen_locker_ = this; | 142 screen_locker_ = this; |
141 } | 143 } |
142 | 144 |
143 void ScreenLocker::Init() { | 145 void ScreenLocker::Init() { |
144 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); | 146 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); |
145 delegate_.reset(new WebUIScreenLocker(this)); | 147 delegate_.reset(new WebUIScreenLocker(this)); |
148 ash::Shell::GetInstance()-> | |
149 desktop_background_controller()-> | |
Ben Goodger (Google)
2012/07/30 21:08:33
same ehre
| |
150 MoveDesktopToLockedContainer(); | |
146 delegate_->LockScreen(unlock_on_input_); | 151 delegate_->LockScreen(unlock_on_input_); |
147 } | 152 } |
148 | 153 |
149 void ScreenLocker::OnLoginFailure(const LoginFailure& error) { | 154 void ScreenLocker::OnLoginFailure(const LoginFailure& error) { |
150 DVLOG(1) << "OnLoginFailure"; | 155 DVLOG(1) << "OnLoginFailure"; |
151 content::RecordAction(UserMetricsAction("ScreenLocker_OnLoginFailure")); | 156 content::RecordAction(UserMetricsAction("ScreenLocker_OnLoginFailure")); |
152 if (authentication_start_time_.is_null()) { | 157 if (authentication_start_time_.is_null()) { |
153 LOG(ERROR) << "authentication_start_time_ is not set"; | 158 LOG(ERROR) << "authentication_start_time_ is not set"; |
154 } else { | 159 } else { |
155 base::TimeDelta delta = base::Time::Now() - authentication_start_time_; | 160 base::TimeDelta delta = base::Time::Now() - authentication_start_time_; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
311 void ScreenLocker::InitClass() { | 316 void ScreenLocker::InitClass() { |
312 g_screen_lock_observer.Get(); | 317 g_screen_lock_observer.Get(); |
313 } | 318 } |
314 | 319 |
315 //////////////////////////////////////////////////////////////////////////////// | 320 //////////////////////////////////////////////////////////////////////////////// |
316 // ScreenLocker, private: | 321 // ScreenLocker, private: |
317 | 322 |
318 ScreenLocker::~ScreenLocker() { | 323 ScreenLocker::~ScreenLocker() { |
319 DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); | 324 DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); |
320 ClearErrors(); | 325 ClearErrors(); |
326 ash::Shell::GetInstance()-> | |
327 desktop_background_controller()-> | |
328 MoveDesktopToUnlockedContainer(); | |
Ben Goodger (Google)
2012/07/30 21:08:33
will this not fit one line up?
| |
321 | 329 |
322 screen_locker_ = NULL; | 330 screen_locker_ = NULL; |
323 bool state = false; | 331 bool state = false; |
324 content::NotificationService::current()->Notify( | 332 content::NotificationService::current()->Notify( |
325 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 333 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
326 content::Source<ScreenLocker>(this), | 334 content::Source<ScreenLocker>(this), |
327 content::Details<bool>(&state)); | 335 content::Details<bool>(&state)); |
328 DBusThreadManager::Get()->GetPowerManagerClient()-> | 336 DBusThreadManager::Get()->GetPowerManagerClient()-> |
329 NotifyScreenUnlockCompleted(); | 337 NotifyScreenUnlockCompleted(); |
330 } | 338 } |
(...skipping 12 matching lines...) Expand all Loading... | |
343 bool state = true; | 351 bool state = true; |
344 content::NotificationService::current()->Notify( | 352 content::NotificationService::current()->Notify( |
345 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, | 353 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED, |
346 content::Source<ScreenLocker>(this), | 354 content::Source<ScreenLocker>(this), |
347 content::Details<bool>(&state)); | 355 content::Details<bool>(&state)); |
348 DBusThreadManager::Get()->GetPowerManagerClient()-> | 356 DBusThreadManager::Get()->GetPowerManagerClient()-> |
349 NotifyScreenLockCompleted(); | 357 NotifyScreenLockCompleted(); |
350 } | 358 } |
351 | 359 |
352 } // namespace chromeos | 360 } // namespace chromeos |
OLD | NEW |