| 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/system/tray/system_tray.h" |
| 10 #include "ash/common/wallpaper/wallpaper_controller.h" | 11 #include "ash/common/wallpaper/wallpaper_controller.h" |
| 11 #include "ash/common/wallpaper/wallpaper_delegate.h" | 12 #include "ash/common/wallpaper/wallpaper_delegate.h" |
| 12 #include "ash/common/wm_shell.h" | 13 #include "ash/common/wm_shell.h" |
| 13 #include "ash/public/cpp/shell_window_ids.h" | 14 #include "ash/public/cpp/shell_window_ids.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" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 39 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" | 40 #include "chrome/browser/chromeos/login/demo_mode/demo_app_launcher.h" |
| 40 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" | 41 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" |
| 41 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 42 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 42 #include "chrome/browser/chromeos/login/helper.h" | 43 #include "chrome/browser/chromeos/login/helper.h" |
| 43 #include "chrome/browser/chromeos/login/login_wizard.h" | 44 #include "chrome/browser/chromeos/login/login_wizard.h" |
| 44 #include "chrome/browser/chromeos/login/screens/core_oobe_view.h" | 45 #include "chrome/browser/chromeos/login/screens/core_oobe_view.h" |
| 45 #include "chrome/browser/chromeos/login/screens/gaia_view.h" | 46 #include "chrome/browser/chromeos/login/screens/gaia_view.h" |
| 46 #include "chrome/browser/chromeos/login/signin/token_handle_util.h" | 47 #include "chrome/browser/chromeos/login/signin/token_handle_util.h" |
| 47 #include "chrome/browser/chromeos/login/startup_utils.h" | 48 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 48 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" | 49 #include "chrome/browser/chromeos/login/ui/input_events_blocker.h" |
| 49 #include "chrome/browser/chromeos/login/ui/keyboard_driven_oobe_key_handler.h" | |
| 50 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 50 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
| 51 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" | 51 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
| 52 #include "chrome/browser/chromeos/login/wizard_controller.h" | 52 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 53 #include "chrome/browser/chromeos/mobile_config.h" | 53 #include "chrome/browser/chromeos/mobile_config.h" |
| 54 #include "chrome/browser/chromeos/net/delay_network_call.h" | 54 #include "chrome/browser/chromeos/net/delay_network_call.h" |
| 55 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 55 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 56 #include "chrome/browser/chromeos/policy/enrollment_config.h" | 56 #include "chrome/browser/chromeos/policy/enrollment_config.h" |
| 57 #include "chrome/browser/chromeos/settings/cros_settings.h" | 57 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 58 #include "chrome/browser/chromeos/system/device_disabling_manager.h" | 58 #include "chrome/browser/chromeos/system/device_disabling_manager.h" |
| 59 #include "chrome/browser/chromeos/system/input_device_settings.h" | 59 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 #include "ui/aura/window.h" | 94 #include "ui/aura/window.h" |
| 95 #include "ui/base/ime/chromeos/extension_ime_util.h" | 95 #include "ui/base/ime/chromeos/extension_ime_util.h" |
| 96 #include "ui/base/ime/chromeos/input_method_manager.h" | 96 #include "ui/base/ime/chromeos/input_method_manager.h" |
| 97 #include "ui/base/l10n/l10n_util.h" | 97 #include "ui/base/l10n/l10n_util.h" |
| 98 #include "ui/base/resource/resource_bundle.h" | 98 #include "ui/base/resource/resource_bundle.h" |
| 99 #include "ui/compositor/layer.h" | 99 #include "ui/compositor/layer.h" |
| 100 #include "ui/compositor/layer_animation_observer.h" | 100 #include "ui/compositor/layer_animation_observer.h" |
| 101 #include "ui/compositor/scoped_layer_animation_settings.h" | 101 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 102 #include "ui/display/display.h" | 102 #include "ui/display/display.h" |
| 103 #include "ui/display/screen.h" | 103 #include "ui/display/screen.h" |
| 104 #include "ui/events/event_handler.h" |
| 104 #include "ui/events/event_utils.h" | 105 #include "ui/events/event_utils.h" |
| 105 #include "ui/gfx/geometry/rect.h" | 106 #include "ui/gfx/geometry/rect.h" |
| 106 #include "ui/gfx/geometry/size.h" | 107 #include "ui/gfx/geometry/size.h" |
| 107 #include "ui/gfx/transform.h" | 108 #include "ui/gfx/transform.h" |
| 108 #include "ui/keyboard/keyboard_controller.h" | 109 #include "ui/keyboard/keyboard_controller.h" |
| 109 #include "ui/keyboard/keyboard_util.h" | 110 #include "ui/keyboard/keyboard_util.h" |
| 110 #include "ui/views/focus/focus_manager.h" | 111 #include "ui/views/focus/focus_manager.h" |
| 111 #include "ui/views/widget/widget.h" | 112 #include "ui/views/widget/widget.h" |
| 112 #include "ui/views/widget/widget_delegate.h" | 113 #include "ui/views/widget/widget_delegate.h" |
| 113 #include "url/gurl.h" | 114 #include "url/gurl.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_NONE); | 292 keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_NONE); |
| 292 } | 293 } |
| 293 | 294 |
| 294 } // namespace | 295 } // namespace |
| 295 | 296 |
| 296 namespace chromeos { | 297 namespace chromeos { |
| 297 | 298 |
| 298 // static | 299 // static |
| 299 const int LoginDisplayHostImpl::kShowLoginWebUIid = 0x1111; | 300 const int LoginDisplayHostImpl::kShowLoginWebUIid = 0x1111; |
| 300 | 301 |
| 302 // A class to handle special menu key for keyboard driven OOBE. |
| 303 class LoginDisplayHostImpl::KeyboardDrivenOobeKeyHandler |
| 304 : public ui::EventHandler { |
| 305 public: |
| 306 KeyboardDrivenOobeKeyHandler() { |
| 307 ash::Shell::GetInstance()->AddPreTargetHandler(this); |
| 308 } |
| 309 ~KeyboardDrivenOobeKeyHandler() override { |
| 310 ash::Shell::GetInstance()->RemovePreTargetHandler(this); |
| 311 } |
| 312 |
| 313 private: |
| 314 // ui::EventHandler |
| 315 void OnKeyEvent(ui::KeyEvent* event) override { |
| 316 if (event->key_code() == ui::VKEY_F6) { |
| 317 ash::Shell::GetInstance()->GetPrimarySystemTray()->CloseSystemBubble(); |
| 318 event->StopPropagation(); |
| 319 } |
| 320 } |
| 321 |
| 322 DISALLOW_COPY_AND_ASSIGN(KeyboardDrivenOobeKeyHandler); |
| 323 }; |
| 324 |
| 301 // A login implementation of WidgetDelegate. | 325 // A login implementation of WidgetDelegate. |
| 302 class LoginDisplayHostImpl::LoginWidgetDelegate : public views::WidgetDelegate { | 326 class LoginDisplayHostImpl::LoginWidgetDelegate : public views::WidgetDelegate { |
| 303 public: | 327 public: |
| 304 LoginWidgetDelegate(views::Widget* widget, LoginDisplayHostImpl* host) | 328 LoginWidgetDelegate(views::Widget* widget, LoginDisplayHostImpl* host) |
| 305 : widget_(widget), login_display_host_(host) { | 329 : widget_(widget), login_display_host_(host) { |
| 306 DCHECK(widget_); | 330 DCHECK(widget_); |
| 307 DCHECK(login_display_host_); | 331 DCHECK(login_display_host_); |
| 308 } | 332 } |
| 309 ~LoginWidgetDelegate() override {} | 333 ~LoginWidgetDelegate() override {} |
| 310 | 334 |
| (...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1458 // Chrome locale. Otherwise it will be lost if Chrome restarts. | 1482 // Chrome locale. Otherwise it will be lost if Chrome restarts. |
| 1459 // Don't need to schedule pref save because setting initial local | 1483 // Don't need to schedule pref save because setting initial local |
| 1460 // will enforce preference saving. | 1484 // will enforce preference saving. |
| 1461 prefs->SetString(prefs::kApplicationLocale, locale); | 1485 prefs->SetString(prefs::kApplicationLocale, locale); |
| 1462 StartupUtils::SetInitialLocale(locale); | 1486 StartupUtils::SetInitialLocale(locale); |
| 1463 | 1487 |
| 1464 TriggerShowLoginWizardFinish(locale, std::move(data)); | 1488 TriggerShowLoginWizardFinish(locale, std::move(data)); |
| 1465 } | 1489 } |
| 1466 | 1490 |
| 1467 } // namespace chromeos | 1491 } // namespace chromeos |
| OLD | NEW |