| 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_aura.h" | 5 #include "chrome/browser/chromeos/login/ui/lock_window_aura.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "ash/wm/window_animations.h" | 9 #include "ash/wm/window_animations.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
| 12 #include "ui/aura/window_event_dispatcher.h" | 12 #include "ui/aura/window_event_dispatcher.h" |
| 13 | 13 |
| 14 #if defined(USE_ATHENA) |
| 15 #include "athena/screen/public/screen_manager.h" |
| 16 #include "athena/util/container_priorities.h" |
| 17 #include "athena/util/fill_layout_manager.h" |
| 18 #endif |
| 19 |
| 14 namespace chromeos { | 20 namespace chromeos { |
| 15 | 21 |
| 16 LockWindow* LockWindow::Create() { | 22 LockWindow* LockWindow::Create() { |
| 17 LockWindowAura* lock_window = new LockWindowAura(); | 23 LockWindowAura* lock_window = new LockWindowAura(); |
| 18 // Cancel existing touch events when screen is locked. | 24 // Cancel existing touch events when screen is locked. |
| 19 ui::GestureRecognizer::Get()->TransferEventsTo( | 25 ui::GestureRecognizer::Get()->TransferEventsTo( |
| 20 lock_window->GetNativeWindow(), NULL); | 26 lock_window->GetNativeWindow(), NULL); |
| 21 return lock_window; | 27 return lock_window; |
| 22 } | 28 } |
| 23 | 29 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 51 } | 57 } |
| 52 | 58 |
| 53 LockWindowAura::~LockWindowAura() { | 59 LockWindowAura::~LockWindowAura() { |
| 54 } | 60 } |
| 55 | 61 |
| 56 void LockWindowAura::Init() { | 62 void LockWindowAura::Init() { |
| 57 views::Widget::InitParams params( | 63 views::Widget::InitParams params( |
| 58 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 64 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 59 params.delegate = this; | 65 params.delegate = this; |
| 60 params.show_state = ui::SHOW_STATE_FULLSCREEN; | 66 params.show_state = ui::SHOW_STATE_FULLSCREEN; |
| 67 #if defined(USE_ATHENA) |
| 68 // Don't set TRANSLUCENT_WINDOW because we don't have wallpaper manager yet. |
| 69 // TODO(dpolukhin): fix this code when crbug.com/408734 fixed. |
| 70 athena::ScreenManager::ContainerParams container_params( |
| 71 "LoginScreen", athena::CP_LOGIN_SCREEN); |
| 72 container_params.can_activate_children = true; |
| 73 container_params.grab_inputs = true; |
| 74 lock_screen_container_.reset( |
| 75 athena::ScreenManager::Get()->CreateContainer(container_params)); |
| 76 params.parent = lock_screen_container_.get(); |
| 77 lock_screen_container_->SetLayoutManager( |
| 78 new athena::FillLayoutManager(lock_screen_container_.get())); |
| 79 #else |
| 61 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 80 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
| 62 // TODO(oshima): move the lock screen harness to ash. | 81 // TODO(oshima): move the lock screen harness to ash. |
| 63 params.parent = | 82 params.parent = |
| 64 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 83 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
| 65 ash::kShellWindowId_LockScreenContainer); | 84 ash::kShellWindowId_LockScreenContainer); |
| 85 #endif |
| 66 views::Widget::Init(params); | 86 views::Widget::Init(params); |
| 67 wm::SetWindowVisibilityAnimationTransition( | 87 wm::SetWindowVisibilityAnimationTransition( |
| 68 GetNativeView(), wm::ANIMATE_NONE); | 88 GetNativeView(), wm::ANIMATE_NONE); |
| 69 } | 89 } |
| 70 | 90 |
| 71 } // namespace chromeos | 91 } // namespace chromeos |
| OLD | NEW |