Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / chromeos / login / ui / lock_window_aura.cc
blob83d35260e65ca6e30ff10f8293b19bbb5613b05f
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"
7 #include "ash/shell.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"
13 namespace chromeos {
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);
19 return lock_window;
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.
27 if (observer_)
28 observer_->OnLockWindowReady();
31 views::Widget* LockWindowAura::GetWidget() {
32 return this;
35 ////////////////////////////////////////////////////////////////////////////////
36 // views::WidgetDelegate implementation:
37 views::View* LockWindowAura::GetInitiallyFocusedView() {
38 return initially_focused_view_;
41 const views::Widget* LockWindowAura::GetWidget() const {
42 return this;
45 ////////////////////////////////////////////////////////////////////////////////
46 // LockWindowAura private:
47 LockWindowAura::LockWindowAura() {
48 Init();
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.
61 params.parent =
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