OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "mash/screenlock/screenlock.h" | 5 #include "mash/screenlock/screenlock.h" |
6 | 6 |
7 #include "ash/public/interfaces/container.mojom.h" | 7 #include "ash/public/cpp/shell_window_ids.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "mash/session/public/interfaces/session.mojom.h" | 10 #include "mash/session/public/interfaces/session.mojom.h" |
11 #include "mojo/public/cpp/bindings/binding.h" | 11 #include "mojo/public/cpp/bindings/binding.h" |
12 #include "services/service_manager/public/cpp/connector.h" | 12 #include "services/service_manager/public/cpp/connector.h" |
13 #include "services/ui/public/cpp/property_type_converters.h" | 13 #include "services/ui/public/cpp/property_type_converters.h" |
14 #include "ui/views/background.h" | 14 #include "ui/views/background.h" |
15 #include "ui/views/controls/button/md_text_button.h" | 15 #include "ui/views/controls/button/md_text_button.h" |
16 #include "ui/views/mus/aura_init.h" | 16 #include "ui/views/mus/aura_init.h" |
17 #include "ui/views/mus/native_widget_mus.h" | 17 #include "ui/views/mus/native_widget_mus.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 new views::AuraInit(connector(), "views_mus_resources.pak")); | 85 new views::AuraInit(connector(), "views_mus_resources.pak")); |
86 window_manager_connection_ = | 86 window_manager_connection_ = |
87 views::WindowManagerConnection::Create(connector(), identity); | 87 views::WindowManagerConnection::Create(connector(), identity); |
88 | 88 |
89 views::Widget* widget = new views::Widget; | 89 views::Widget* widget = new views::Widget; |
90 views::Widget::InitParams params( | 90 views::Widget::InitParams params( |
91 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 91 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
92 params.delegate = new ScreenlockView(connector()); | 92 params.delegate = new ScreenlockView(connector()); |
93 | 93 |
94 std::map<std::string, std::vector<uint8_t>> properties; | 94 std::map<std::string, std::vector<uint8_t>> properties; |
95 properties[ash::mojom::kWindowContainer_Property] = | 95 properties[ui::mojom::WindowManager::kInitialContainerId_Property] = |
96 mojo::ConvertTo<std::vector<uint8_t>>( | 96 mojo::ConvertTo<std::vector<uint8_t>>( |
97 static_cast<int32_t>(ash::mojom::Container::LOGIN_WINDOWS)); | 97 ash::kShellWindowId_LockScreenContainer); |
98 ui::Window* window = | 98 ui::Window* window = |
99 views::WindowManagerConnection::Get()->NewTopLevelWindow(properties); | 99 views::WindowManagerConnection::Get()->NewTopLevelWindow(properties); |
100 params.native_widget = new views::NativeWidgetMus( | 100 params.native_widget = new views::NativeWidgetMus( |
101 widget, window, ui::mojom::SurfaceType::DEFAULT); | 101 widget, window, ui::mojom::SurfaceType::DEFAULT); |
102 widget->Init(params); | 102 widget->Init(params); |
103 widget->Show(); | 103 widget->Show(); |
104 } | 104 } |
105 | 105 |
106 void Screenlock::ScreenlockStateChanged(bool screen_locked) { | 106 void Screenlock::ScreenlockStateChanged(bool screen_locked) { |
107 if (!screen_locked) | 107 if (!screen_locked) |
108 base::MessageLoop::current()->QuitWhenIdle(); | 108 base::MessageLoop::current()->QuitWhenIdle(); |
109 } | 109 } |
110 | 110 |
111 } // namespace screenlock | 111 } // namespace screenlock |
112 } // namespace mash | 112 } // namespace mash |
OLD | NEW |