| 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/ui/lock_window.h" | 5 #include "chrome/browser/chromeos/login/ui/lock_window.h" |
| 6 | 6 |
| 7 #include "ash/common/shell_window_ids.h" | 7 #include "ash/common/shell_window_ids.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/events/gestures/gesture_recognizer.h" | 10 #include "ui/events/gestures/gesture_recognizer.h" |
| 11 | 11 |
| 12 namespace chromeos { | 12 namespace chromeos { |
| 13 | 13 |
| 14 LockWindow::LockWindow() { | 14 LockWindow::LockWindow() { |
| 15 ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr); | 15 ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr); |
| 16 | 16 |
| 17 views::Widget::InitParams params( | 17 views::Widget::InitParams params( |
| 18 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 18 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 19 params.delegate = this; | 19 params.delegate = this; |
| 20 params.show_state = ui::SHOW_STATE_FULLSCREEN; | 20 params.show_state = ui::SHOW_STATE_FULLSCREEN; |
| 21 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 21 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 22 params.parent = | 22 params.parent = |
| 23 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 23 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
| 24 ash::kShellWindowId_LockScreenContainer); | 24 ash::kShellWindowId_LockScreenContainer); |
| 25 views::Widget::Init(params); | 25 Init(params); |
| 26 SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE); | 26 SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE); |
| 27 } | 27 } |
| 28 | 28 |
| 29 LockWindow::~LockWindow() {} | 29 LockWindow::~LockWindow() {} |
| 30 | 30 |
| 31 void LockWindow::Grab() { | |
| 32 // We already have grab from the lock screen container, just call the ready | |
| 33 // callback immediately. | |
| 34 if (observer_) | |
| 35 observer_->OnLockWindowReady(); | |
| 36 } | |
| 37 | |
| 38 views::Widget* LockWindow::GetWidget() { | 31 views::Widget* LockWindow::GetWidget() { |
| 39 return this; | 32 return this; |
| 40 } | 33 } |
| 41 | 34 |
| 42 const views::Widget* LockWindow::GetWidget() const { | 35 const views::Widget* LockWindow::GetWidget() const { |
| 43 return this; | 36 return this; |
| 44 } | 37 } |
| 45 | 38 |
| 46 views::View* LockWindow::GetInitiallyFocusedView() { | 39 views::View* LockWindow::GetInitiallyFocusedView() { |
| 47 return initially_focused_view_; | 40 return initially_focused_view_; |
| 48 } | 41 } |
| 49 | 42 |
| 50 } // namespace chromeos | 43 } // namespace chromeos |
| OLD | NEW |