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()->TransferEventsTo(
19 lock_window
->GetNativeWindow(), NULL
);
23 ////////////////////////////////////////////////////////////////////////////////
24 // LockWindow implementation:
25 void LockWindowAura::Grab() {
26 // We already have grab from the lock screen container, just call the ready
27 // callback immediately.
29 observer_
->OnLockWindowReady();
32 views::Widget
* LockWindowAura::GetWidget() {
36 ////////////////////////////////////////////////////////////////////////////////
37 // views::WidgetDelegate implementation:
38 views::View
* LockWindowAura::GetInitiallyFocusedView() {
39 return initially_focused_view_
;
42 const views::Widget
* LockWindowAura::GetWidget() const {
46 ////////////////////////////////////////////////////////////////////////////////
47 // LockWindowAura private:
48 LockWindowAura::LockWindowAura() {
52 LockWindowAura::~LockWindowAura() {
55 void LockWindowAura::Init() {
56 views::Widget::InitParams
params(
57 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS
);
58 params
.delegate
= this;
59 params
.show_state
= ui::SHOW_STATE_FULLSCREEN
;
60 params
.opacity
= views::Widget::InitParams::TRANSLUCENT_WINDOW
;
61 // TODO(oshima): move the lock screen harness to ash.
63 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
64 ash::kShellWindowId_LockScreenContainer
);
65 views::Widget::Init(params
);
66 SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE
);
69 } // namespace chromeos