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/public/cpp/shell_window_ids.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "chrome/browser/ui/ash/ash_util.h" | 9 #include "chrome/browser/ui/ash/ash_util.h" |
10 #include "services/ui/public/cpp/property_type_converters.h" | 10 #include "services/ui/public/cpp/property_type_converters.h" |
11 #include "services/ui/public/interfaces/window_manager.mojom.h" | 11 #include "services/ui/public/interfaces/window_manager.mojom.h" |
12 #include "ui/aura/mus/property_converter.h" | |
12 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
13 #include "ui/events/gestures/gesture_recognizer.h" | 14 #include "ui/events/gestures/gesture_recognizer.h" |
14 | 15 |
15 namespace chromeos { | 16 namespace chromeos { |
16 | 17 |
17 LockWindow::LockWindow(views::View* initially_focused_view) | 18 LockWindow::LockWindow(views::View* initially_focused_view) |
18 : initially_focused_view_(initially_focused_view) { | 19 : initially_focused_view_(initially_focused_view) { |
19 ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr); | 20 ui::GestureRecognizer::Get()->CancelActiveTouchesExcept(nullptr); |
20 | 21 |
21 views::Widget::InitParams params( | 22 views::Widget::InitParams params( |
22 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 23 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
23 params.delegate = this; | 24 params.delegate = this; |
24 params.show_state = ui::SHOW_STATE_FULLSCREEN; | 25 params.show_state = ui::SHOW_STATE_FULLSCREEN; |
25 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 26 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
26 const int kLockContainer = ash::kShellWindowId_LockScreenContainer; | 27 const int kLockContainer = ash::kShellWindowId_LockScreenContainer; |
27 if (ash_util::IsRunningInMash()) { | 28 if (ash_util::IsRunningInMash()) { |
28 using ui::mojom::WindowManager; | 29 using ui::mojom::WindowManager; |
29 params.mus_properties[WindowManager::kContainerId_InitProperty] = | 30 params.mus_properties[WindowManager::kContainerId_InitProperty] = |
30 mojo::ConvertTo<std::vector<uint8_t>>(kLockContainer); | 31 mojo::ConvertTo<std::vector<uint8_t>>(kLockContainer); |
32 params.mus_properties[WindowManager::kShowState_Property] = | |
James Cook
2017/04/25 19:42:28
It seems bad that setting Views::Widget::InitParam
sky
2017/04/25 22:35:43
Setting the SHOW_STATE_FULLSCREEN on the init para
| |
33 mojo::ConvertTo<std::vector<uint8_t>>( | |
34 static_cast<aura::PropertyConverter::PrimitiveType>( | |
35 ui::mojom::ShowState::FULLSCREEN)); | |
31 } else { | 36 } else { |
32 params.parent = ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 37 params.parent = ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
33 kLockContainer); | 38 kLockContainer); |
34 } | 39 } |
35 Init(params); | 40 Init(params); |
36 SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE); | 41 SetVisibilityAnimationTransition(views::Widget::ANIMATE_NONE); |
37 } | 42 } |
38 | 43 |
39 LockWindow::~LockWindow() {} | 44 LockWindow::~LockWindow() {} |
40 | 45 |
41 views::Widget* LockWindow::GetWidget() { | 46 views::Widget* LockWindow::GetWidget() { |
42 return this; | 47 return this; |
43 } | 48 } |
44 | 49 |
45 const views::Widget* LockWindow::GetWidget() const { | 50 const views::Widget* LockWindow::GetWidget() const { |
46 return this; | 51 return this; |
47 } | 52 } |
48 | 53 |
49 views::View* LockWindow::GetInitiallyFocusedView() { | 54 views::View* LockWindow::GetInitiallyFocusedView() { |
50 return initially_focused_view_; | 55 return initially_focused_view_; |
51 } | 56 } |
52 | 57 |
53 } // namespace chromeos | 58 } // namespace chromeos |
OLD | NEW |