Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / chromeos / login / lock_window_aura.cc
blob02e69899ae0e526ab8b3fab6b62cfa75b37ab288
1 // Copyright (c) 2012 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/lock_window_aura.h"
7 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h"
9 #include "ash/wm/window_animations.h"
10 #include "base/command_line.h"
11 #include "ui/aura/root_window.h"
12 #include "ui/aura/window.h"
14 namespace chromeos {
16 LockWindow* LockWindow::Create() {
17 LockWindowAura* lock_window = new LockWindowAura();
18 // Cancel existing touch events when screen is locked.
19 ui::GestureRecognizer::Get()->TransferEventsTo(
20 lock_window->GetNativeWindow(), NULL);
21 return lock_window;
24 ////////////////////////////////////////////////////////////////////////////////
25 // LockWindow implementation:
26 void LockWindowAura::Grab() {
27 // We already have grab from the lock screen container, just call the ready
28 // callback immediately.
29 if (observer_)
30 observer_->OnLockWindowReady();
33 views::Widget* LockWindowAura::GetWidget() {
34 return this;
37 ////////////////////////////////////////////////////////////////////////////////
38 // LockWindowAura private:
39 LockWindowAura::LockWindowAura() {
40 Init();
43 LockWindowAura::~LockWindowAura() {
46 void LockWindowAura::Init() {
47 views::Widget::InitParams params(
48 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
49 params.show_state = ui::SHOW_STATE_FULLSCREEN;
50 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
51 // TODO(oshima): move the lock screen harness to ash.
52 params.parent =
53 ash::Shell::GetContainer(
54 ash::Shell::GetPrimaryRootWindow(),
55 ash::internal::kShellWindowId_LockScreenContainer);
56 views::Widget::Init(params);
57 views::corewm::SetWindowVisibilityAnimationTransition(
58 GetNativeView(), views::corewm::ANIMATE_NONE);
61 } // namespace chromeos