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
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/login/ui/lock_window_aura.h"
8 #include "ash/shell_window_ids.h"
9 #include "base/command_line.h"
10 #include "ui/aura/window.h"
11 #include "ui/aura/window_event_dispatcher.h"
15 LockWindow
* LockWindow::Create() {
16 LockWindowAura
* lock_window
= new LockWindowAura();
17 // Cancel existing touch events when screen is locked.
18 ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr);
22 ////////////////////////////////////////////////////////////////////////////////
23 // LockWindow implementation:
24 void LockWindowAura::Grab() {
25 // We already have grab from the lock screen container, just call the ready
26 // callback immediately.
28 observer_
->OnLockWindowReady();
31 views::Widget
* LockWindowAura::GetWidget() {
35 ////////////////////////////////////////////////////////////////////////////////
36 // views::WidgetDelegate implementation:
37 views::View
* LockWindowAura::GetInitiallyFocusedView() {
38 return initially_focused_view_
;
41 const views::Widget
* LockWindowAura::GetWidget() const {
45 ////////////////////////////////////////////////////////////////////////////////
46 // LockWindowAura private:
47 LockWindowAura::LockWindowAura() {
51 LockWindowAura::~LockWindowAura() {
54 void LockWindowAura::Init() {
55 views::Widget::InitParams
params(
56 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS
);
57 params
.delegate
= this;
58 params
.show_state
= ui::SHOW_STATE_FULLSCREEN
;
59 params
.opacity
= views::Widget::InitParams::TRANSLUCENT_WINDOW
;
60 // TODO(oshima): move the lock screen harness to ash.
62 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
63 ash::kShellWindowId_LockScreenContainer
);
64 views::Widget::Init(params
);
65 SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE
);
68 } // namespace chromeos