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/login/login.h" | 5 #include "mash/login/login.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/public/interfaces/container.mojom.h" | 10 #include "ash/public/interfaces/container.mojom.h" |
11 #include "base/guid.h" | 11 #include "base/guid.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/message_loop/message_loop.h" | 13 #include "base/message_loop/message_loop.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "mash/init/public/interfaces/init.mojom.h" | 15 #include "mash/init/public/interfaces/init.mojom.h" |
16 #include "mash/login/public/interfaces/login.mojom.h" | 16 #include "mash/login/public/interfaces/login.mojom.h" |
17 #include "mojo/public/cpp/bindings/binding_set.h" | 17 #include "mojo/public/cpp/bindings/binding_set.h" |
18 #include "services/shell/public/cpp/connector.h" | 18 #include "services/shell/public/cpp/connector.h" |
19 #include "services/shell/public/cpp/service.h" | 19 #include "services/shell/public/cpp/service.h" |
20 #include "services/tracing/public/cpp/tracing_impl.h" | 20 #include "services/tracing/public/cpp/provider.h" |
21 #include "services/ui/public/cpp/property_type_converters.h" | 21 #include "services/ui/public/cpp/property_type_converters.h" |
22 #include "services/ui/public/interfaces/user_access_manager.mojom.h" | 22 #include "services/ui/public/interfaces/user_access_manager.mojom.h" |
23 #include "ui/views/background.h" | 23 #include "ui/views/background.h" |
24 #include "ui/views/controls/button/label_button.h" | 24 #include "ui/views/controls/button/label_button.h" |
25 #include "ui/views/mus/aura_init.h" | 25 #include "ui/views/mus/aura_init.h" |
26 #include "ui/views/mus/native_widget_mus.h" | 26 #include "ui/views/mus/native_widget_mus.h" |
27 #include "ui/views/mus/window_manager_connection.h" | 27 #include "ui/views/mus/window_manager_connection.h" |
28 #include "ui/views/widget/widget_delegate.h" | 28 #include "ui/views/widget/widget_delegate.h" |
29 | 29 |
30 namespace mash { | 30 namespace mash { |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 void ShowLoginUI() override { | 173 void ShowLoginUI() override { |
174 UI::Show(connector(), identity_, this); | 174 UI::Show(connector(), identity_, this); |
175 } | 175 } |
176 void SwitchUser() override { | 176 void SwitchUser() override { |
177 UI::Show(connector(), identity_, this); | 177 UI::Show(connector(), identity_, this); |
178 } | 178 } |
179 | 179 |
180 void StartWindowManager(); | 180 void StartWindowManager(); |
181 | 181 |
182 shell::Identity identity_; | 182 shell::Identity identity_; |
183 mojo::TracingImpl tracing_; | 183 tracing::Provider tracing_; |
184 std::unique_ptr<views::AuraInit> aura_init_; | 184 std::unique_ptr<views::AuraInit> aura_init_; |
185 mojo::BindingSet<mojom::Login> bindings_; | 185 mojo::BindingSet<mojom::Login> bindings_; |
186 ui::mojom::UserAccessManagerPtr user_access_manager_; | 186 ui::mojom::UserAccessManagerPtr user_access_manager_; |
187 | 187 |
188 DISALLOW_COPY_AND_ASSIGN(Login); | 188 DISALLOW_COPY_AND_ASSIGN(Login); |
189 }; | 189 }; |
190 | 190 |
191 void UI::ButtonPressed(views::Button* sender, const ui::Event& event) { | 191 void UI::ButtonPressed(views::Button* sender, const ui::Event& event) { |
192 // Login... | 192 // Login... |
193 if (sender == login_button_1_) { | 193 if (sender == login_button_1_) { |
194 login_->LoginAs(user_id_1_); | 194 login_->LoginAs(user_id_1_); |
195 } else if (sender == login_button_2_) { | 195 } else if (sender == login_button_2_) { |
196 login_->LoginAs(user_id_2_); | 196 login_->LoginAs(user_id_2_); |
197 } else { | 197 } else { |
198 NOTREACHED(); | 198 NOTREACHED(); |
199 } | 199 } |
200 GetWidget()->Close(); | 200 GetWidget()->Close(); |
201 } | 201 } |
202 | 202 |
203 } // namespace | 203 } // namespace |
204 | 204 |
205 shell::Service* CreateLogin() { | 205 shell::Service* CreateLogin() { |
206 return new Login; | 206 return new Login; |
207 } | 207 } |
208 | 208 |
209 } // namespace login | 209 } // namespace login |
210 } // namespace main | 210 } // namespace main |
OLD | NEW |