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/login_display_host_impl.h" | 5 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/common/shell_window_ids.h" | 10 #include "ash/common/shell_window_ids.h" |
11 #include "ash/common/wm_shell.h" | 11 #include "ash/common/wm_shell.h" |
12 #include "ash/desktop_background/desktop_background_controller.h" | 12 #include "ash/desktop_background/desktop_background_controller.h" |
13 #include "ash/desktop_background/user_wallpaper_delegate.h" | 13 #include "ash/desktop_background/user_wallpaper_delegate.h" |
| 14 #include "ash/public/interfaces/container.mojom.h" |
14 #include "ash/shell.h" | 15 #include "ash/shell.h" |
15 #include "base/bind.h" | 16 #include "base/bind.h" |
16 #include "base/command_line.h" | 17 #include "base/command_line.h" |
17 #include "base/location.h" | 18 #include "base/location.h" |
18 #include "base/logging.h" | 19 #include "base/logging.h" |
19 #include "base/macros.h" | 20 #include "base/macros.h" |
20 #include "base/single_thread_task_runner.h" | 21 #include "base/single_thread_task_runner.h" |
21 #include "base/strings/string_split.h" | 22 #include "base/strings/string_split.h" |
22 #include "base/strings/utf_string_conversions.h" | 23 #include "base/strings/utf_string_conversions.h" |
23 #include "base/threading/thread_restrictions.h" | 24 #include "base/threading/thread_restrictions.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 #include "chromeos/timezone/timezone_resolver.h" | 81 #include "chromeos/timezone/timezone_resolver.h" |
81 #include "components/prefs/pref_service.h" | 82 #include "components/prefs/pref_service.h" |
82 #include "components/session_manager/core/session_manager.h" | 83 #include "components/session_manager/core/session_manager.h" |
83 #include "components/user_manager/user.h" | 84 #include "components/user_manager/user.h" |
84 #include "components/user_manager/user_manager.h" | 85 #include "components/user_manager/user_manager.h" |
85 #include "content/public/browser/notification_service.h" | 86 #include "content/public/browser/notification_service.h" |
86 #include "content/public/browser/notification_types.h" | 87 #include "content/public/browser/notification_types.h" |
87 #include "content/public/browser/web_contents.h" | 88 #include "content/public/browser/web_contents.h" |
88 #include "content/public/browser/web_ui.h" | 89 #include "content/public/browser/web_ui.h" |
89 #include "media/audio/sounds/sounds_manager.h" | 90 #include "media/audio/sounds/sounds_manager.h" |
| 91 #include "services/ui/public/cpp/property_type_converters.h" |
90 #include "ui/aura/window.h" | 92 #include "ui/aura/window.h" |
91 #include "ui/base/ime/chromeos/extension_ime_util.h" | 93 #include "ui/base/ime/chromeos/extension_ime_util.h" |
92 #include "ui/base/ime/chromeos/input_method_manager.h" | 94 #include "ui/base/ime/chromeos/input_method_manager.h" |
93 #include "ui/base/resource/resource_bundle.h" | 95 #include "ui/base/resource/resource_bundle.h" |
94 #include "ui/compositor/layer.h" | 96 #include "ui/compositor/layer.h" |
95 #include "ui/compositor/layer_animation_observer.h" | 97 #include "ui/compositor/layer_animation_observer.h" |
96 #include "ui/compositor/scoped_layer_animation_settings.h" | 98 #include "ui/compositor/scoped_layer_animation_settings.h" |
97 #include "ui/display/display.h" | 99 #include "ui/display/display.h" |
98 #include "ui/display/screen.h" | 100 #include "ui/display/screen.h" |
99 #include "ui/events/event_utils.h" | 101 #include "ui/events/event_utils.h" |
100 #include "ui/gfx/geometry/rect.h" | 102 #include "ui/gfx/geometry/rect.h" |
101 #include "ui/gfx/geometry/size.h" | 103 #include "ui/gfx/geometry/size.h" |
102 #include "ui/gfx/transform.h" | 104 #include "ui/gfx/transform.h" |
103 #include "ui/keyboard/keyboard_controller.h" | 105 #include "ui/keyboard/keyboard_controller.h" |
104 #include "ui/keyboard/keyboard_util.h" | 106 #include "ui/keyboard/keyboard_util.h" |
105 #include "ui/views/focus/focus_manager.h" | 107 #include "ui/views/focus/focus_manager.h" |
106 #include "ui/views/widget/widget.h" | 108 #include "ui/views/widget/widget.h" |
107 #include "ui/views/widget/widget_delegate.h" | 109 #include "ui/views/widget/widget_delegate.h" |
108 #include "url/gurl.h" | 110 #include "url/gurl.h" |
109 | 111 |
110 #if defined(MOJO_SHELL_CLIENT) | |
111 #include "ash/public/interfaces/container.mojom.h" | |
112 #include "services/ui/public/cpp/property_type_converters.h" | |
113 #endif | |
114 | |
115 namespace { | 112 namespace { |
116 | 113 |
117 // Maximum delay for startup sound after 'loginPromptVisible' signal. | 114 // Maximum delay for startup sound after 'loginPromptVisible' signal. |
118 const int kStartupSoundMaxDelayMs = 2000; | 115 const int kStartupSoundMaxDelayMs = 2000; |
119 | 116 |
120 // URL which corresponds to the login WebUI. | 117 // URL which corresponds to the login WebUI. |
121 const char kLoginURL[] = "chrome://oobe/login"; | 118 const char kLoginURL[] = "chrome://oobe/login"; |
122 | 119 |
123 // URL which corresponds to the OOBE WebUI. | 120 // URL which corresponds to the OOBE WebUI. |
124 const char kOobeURL[] = "chrome://oobe/oobe"; | 121 const char kOobeURL[] = "chrome://oobe/oobe"; |
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1134 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 1131 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
1135 params.bounds = background_bounds(); | 1132 params.bounds = background_bounds(); |
1136 params.show_state = ui::SHOW_STATE_FULLSCREEN; | 1133 params.show_state = ui::SHOW_STATE_FULLSCREEN; |
1137 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; | 1134 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; |
1138 // The ash::Shell containers are not available in Mash | 1135 // The ash::Shell containers are not available in Mash |
1139 if (!chrome::IsRunningInMash()) { | 1136 if (!chrome::IsRunningInMash()) { |
1140 params.parent = | 1137 params.parent = |
1141 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), | 1138 ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
1142 ash::kShellWindowId_LockScreenContainer); | 1139 ash::kShellWindowId_LockScreenContainer); |
1143 } else { | 1140 } else { |
1144 #if defined(MOJO_SHELL_CLIENT) | |
1145 params.mus_properties[ash::mojom::kWindowContainer_Property] = | 1141 params.mus_properties[ash::mojom::kWindowContainer_Property] = |
1146 mojo::ConvertTo<std::vector<uint8_t>>( | 1142 mojo::ConvertTo<std::vector<uint8_t>>( |
1147 static_cast<int32_t>(ash::mojom::Container::LOGIN_WINDOWS)); | 1143 static_cast<int32_t>(ash::mojom::Container::LOGIN_WINDOWS)); |
1148 #else | |
1149 NOTREACHED(); | |
1150 #endif | |
1151 } | 1144 } |
1152 login_window_ = new views::Widget; | 1145 login_window_ = new views::Widget; |
1153 params.delegate = new LoginWidgetDelegate(login_window_); | 1146 params.delegate = new LoginWidgetDelegate(login_window_); |
1154 login_window_->Init(params); | 1147 login_window_->Init(params); |
1155 | 1148 |
1156 login_view_ = new WebUILoginView(); | 1149 login_view_ = new WebUILoginView(); |
1157 login_view_->Init(); | 1150 login_view_->Init(); |
1158 if (login_view_->webui_visible()) | 1151 if (login_view_->webui_visible()) |
1159 OnLoginPromptVisible(); | 1152 OnLoginPromptVisible(); |
1160 | 1153 |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 | 1372 |
1380 locale_util::SwitchLanguageCallback callback( | 1373 locale_util::SwitchLanguageCallback callback( |
1381 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); | 1374 base::Bind(&OnLanguageSwitchedCallback, base::Passed(std::move(data)))); |
1382 | 1375 |
1383 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1376 // Load locale keyboards here. Hardware layout would be automatically enabled. |
1384 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, | 1377 locale_util::SwitchLanguage(locale, true, true /* login_layouts_only */, |
1385 callback, ProfileManager::GetActiveUserProfile()); | 1378 callback, ProfileManager::GetActiveUserProfile()); |
1386 } | 1379 } |
1387 | 1380 |
1388 } // namespace chromeos | 1381 } // namespace chromeos |
OLD | NEW |