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/webui_screen_locker.h" | 5 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h" |
6 | 6 |
7 #include "ash/shell.h" | |
8 #include "ash/system/power/power_event_observer.h" | |
9 #include "base/command_line.h" | 7 #include "base/command_line.h" |
10 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
11 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
12 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
13 #include "base/values.h" | 11 #include "base/values.h" |
14 #include "chrome/browser/browser_shutdown.h" | 12 #include "chrome/browser/browser_shutdown.h" |
15 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
16 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 14 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
17 #include "chrome/browser/chromeos/login/helper.h" | 15 #include "chrome/browser/chromeos/login/helper.h" |
18 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 16 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
19 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h" | 17 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h" |
20 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h" | 18 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h" |
21 #include "chrome/browser/chromeos/login/ui/preloaded_web_view.h" | 19 #include "chrome/browser/chromeos/login/ui/preloaded_web_view.h" |
22 #include "chrome/browser/chromeos/login/ui/preloaded_web_view_factory.h" | 20 #include "chrome/browser/chromeos/login/ui/preloaded_web_view_factory.h" |
23 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 21 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
24 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 22 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
25 #include "chrome/browser/ui/ash/ash_util.h" | 23 #include "chrome/browser/ui/ash/ash_util.h" |
| 24 #include "chrome/browser/ui/ash/session_controller_client.h" |
26 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 25 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
27 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" | 26 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
28 #include "chrome/common/chrome_features.h" | 27 #include "chrome/common/chrome_features.h" |
29 #include "chrome/common/pref_names.h" | 28 #include "chrome/common/pref_names.h" |
30 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
31 #include "chrome/grit/generated_resources.h" | 30 #include "chrome/grit/generated_resources.h" |
32 #include "chromeos/dbus/dbus_thread_manager.h" | 31 #include "chromeos/dbus/dbus_thread_manager.h" |
33 #include "components/login/base_screen_handler_utils.h" | 32 #include "components/login/base_screen_handler_utils.h" |
34 #include "components/prefs/pref_service.h" | 33 #include "components/prefs/pref_service.h" |
35 #include "components/user_manager/user.h" | 34 #include "components/user_manager/user.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 if (lock_ready_) | 248 if (lock_ready_) |
250 ScreenLockReady(); | 249 ScreenLockReady(); |
251 } | 250 } |
252 | 251 |
253 void WebUIScreenLocker::OnLockBackgroundDisplayed() { | 252 void WebUIScreenLocker::OnLockBackgroundDisplayed() { |
254 UMA_HISTOGRAM_TIMES("LockScreen.BackgroundReady", | 253 UMA_HISTOGRAM_TIMES("LockScreen.BackgroundReady", |
255 base::TimeTicks::Now() - lock_time_); | 254 base::TimeTicks::Now() - lock_time_); |
256 } | 255 } |
257 | 256 |
258 void WebUIScreenLocker::OnHeaderBarVisible() { | 257 void WebUIScreenLocker::OnHeaderBarVisible() { |
259 DCHECK(ash::Shell::HasInstance()); | 258 SessionControllerClient::Get()->NotifyChromeLockAnimationsComplete(); |
260 | |
261 ash::Shell::Get()->power_event_observer()->OnLockAnimationsComplete(); | |
262 } | 259 } |
263 | 260 |
264 void WebUIScreenLocker::OnLockAnimationFinished() { | 261 void WebUIScreenLocker::OnAshLockAnimationFinished() { |
265 // Release capture if any. | 262 // Release capture if any. |
266 aura::client::GetCaptureClient(GetNativeWindow()->GetRootWindow()) | 263 aura::client::GetCaptureClient(GetNativeWindow()->GetRootWindow()) |
267 ->SetCapture(nullptr); | 264 ->SetCapture(nullptr); |
268 GetWebUI()->CallJavascriptFunctionUnsafe( | 265 GetWebUI()->CallJavascriptFunctionUnsafe( |
269 "cr.ui.Oobe.animateOnceFullyDisplayed"); | 266 "cr.ui.Oobe.animateOnceFullyDisplayed"); |
270 } | 267 } |
271 | 268 |
272 void WebUIScreenLocker::SetFingerprintState(const AccountId& account_id, | 269 void WebUIScreenLocker::SetFingerprintState(const AccountId& account_id, |
273 FingerprintState state) { | 270 FingerprintState state) { |
274 // TODO(xiaoyinh@): Modify JS side to consolidate removeUserPodFingerprintIcon | 271 // TODO(xiaoyinh@): Modify JS side to consolidate removeUserPodFingerprintIcon |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 } | 431 } |
435 | 432 |
436 if (GetOobeUI()) { | 433 if (GetOobeUI()) { |
437 const gfx::Size& size = primary_display.size(); | 434 const gfx::Size& size = primary_display.size(); |
438 GetOobeUI()->GetCoreOobeView()->SetClientAreaSize(size.width(), | 435 GetOobeUI()->GetCoreOobeView()->SetClientAreaSize(size.width(), |
439 size.height()); | 436 size.height()); |
440 } | 437 } |
441 } | 438 } |
442 | 439 |
443 } // namespace chromeos | 440 } // namespace chromeos |
OLD | NEW |