Chromium Code Reviews| 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/webui_login_view.h" | 5 #include "chrome/browser/chromeos/login/ui/webui_login_view.h" |
| 6 | 6 |
| 7 #include "ash/focus_cycler.h" | 7 #include "ash/focus_cycler.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/status_area_widget_delegate.h" | 9 #include "ash/system/status_area_widget_delegate.h" |
| 10 #include "ash/system/tray/system_tray.h" | 10 #include "ash/system/tray/system_tray.h" |
| 11 #include "ash/system/tray/system_tray_notifier.h" | 11 #include "ash/system/tray/system_tray_notifier.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "base/trace_event/trace_event.h" | 18 #include "base/trace_event/trace_event.h" |
| 19 #include "base/values.h" | 19 #include "base/values.h" |
| 20 #include "chrome/browser/chrome_notification_types.h" | 20 #include "chrome/browser/chrome_notification_types.h" |
| 21 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 21 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
| 22 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 22 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 23 #include "chrome/browser/chromeos/login/enrollment/auto_enrollment_controller.h" | |
| 23 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 24 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
| 24 #include "chrome/browser/chromeos/login/ui/preloaded_web_view.h" | 25 #include "chrome/browser/chromeos/login/ui/preloaded_web_view.h" |
| 25 #include "chrome/browser/chromeos/login/ui/preloaded_web_view_factory.h" | 26 #include "chrome/browser/chromeos/login/ui/preloaded_web_view_factory.h" |
| 26 #include "chrome/browser/chromeos/login/ui/proxy_settings_dialog.h" | 27 #include "chrome/browser/chromeos/login/ui/proxy_settings_dialog.h" |
| 27 #include "chrome/browser/chromeos/login/ui/web_contents_forced_title.h" | 28 #include "chrome/browser/chromeos/login/ui/web_contents_forced_title.h" |
| 28 #include "chrome/browser/chromeos/login/ui/web_contents_set_background_color.h" | 29 #include "chrome/browser/chromeos/login/ui/web_contents_set_background_color.h" |
| 29 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 30 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
| 30 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 31 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 31 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 32 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
| 32 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" | 33 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 53 #include "content/public/browser/web_ui.h" | 54 #include "content/public/browser/web_ui.h" |
| 54 #include "content/public/common/renderer_preferences.h" | 55 #include "content/public/common/renderer_preferences.h" |
| 55 #include "extensions/browser/view_type_utils.h" | 56 #include "extensions/browser/view_type_utils.h" |
| 56 #include "third_party/WebKit/public/platform/WebInputEvent.h" | 57 #include "third_party/WebKit/public/platform/WebInputEvent.h" |
| 57 #include "ui/gfx/geometry/rect.h" | 58 #include "ui/gfx/geometry/rect.h" |
| 58 #include "ui/gfx/geometry/size.h" | 59 #include "ui/gfx/geometry/size.h" |
| 59 #include "ui/keyboard/keyboard_controller.h" | 60 #include "ui/keyboard/keyboard_controller.h" |
| 60 #include "ui/views/controls/webview/webview.h" | 61 #include "ui/views/controls/webview/webview.h" |
| 61 #include "ui/views/widget/widget.h" | 62 #include "ui/views/widget/widget.h" |
| 62 | 63 |
| 64 using chromeos::AutoEnrollmentController; | |
| 63 using content::NativeWebKeyboardEvent; | 65 using content::NativeWebKeyboardEvent; |
| 64 using content::RenderViewHost; | 66 using content::RenderViewHost; |
| 65 using content::WebContents; | 67 using content::WebContents; |
| 66 using web_modal::WebContentsModalDialogManager; | 68 using web_modal::WebContentsModalDialogManager; |
| 67 | 69 |
| 68 namespace { | 70 namespace { |
| 69 | 71 |
| 70 // These strings must be kept in sync with handleAccelerator() | 72 // These strings must be kept in sync with handleAccelerator() |
| 71 // in display_manager.js. | 73 // in display_manager.js. |
| 72 const char kAccelNameCancel[] = "cancel"; | 74 const char kAccelNameCancel[] = "cancel"; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 accel_map_[ui::Accelerator(ui::VKEY_E, | 136 accel_map_[ui::Accelerator(ui::VKEY_E, |
| 135 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = | 137 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = |
| 136 kAccelNameEnrollment; | 138 kAccelNameEnrollment; |
| 137 if (KioskAppManager::IsConsumerKioskEnabled()) { | 139 if (KioskAppManager::IsConsumerKioskEnabled()) { |
| 138 accel_map_[ui::Accelerator(ui::VKEY_K, | 140 accel_map_[ui::Accelerator(ui::VKEY_K, |
| 139 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = | 141 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN)] = |
| 140 kAccelNameKioskEnable; | 142 kAccelNameKioskEnable; |
| 141 } | 143 } |
| 142 accel_map_[ui::Accelerator(ui::VKEY_V, ui::EF_ALT_DOWN)] = | 144 accel_map_[ui::Accelerator(ui::VKEY_V, ui::EF_ALT_DOWN)] = |
| 143 kAccelNameVersion; | 145 kAccelNameVersion; |
| 144 accel_map_[ui::Accelerator(ui::VKEY_R, | 146 |
| 145 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] = | 147 // The devices with forced re-enrollment enabled shouldn't be able to |
|
achuithb
2017/05/23 19:59:01
nit: drop 'The'
| |
| 146 kAccelNameReset; | 148 // powerwash. |
| 149 const AutoEnrollmentController::FRERequirement requirement = | |
| 150 AutoEnrollmentController::GetFRERequirement(); | |
| 151 if (requirement == AutoEnrollmentController::NOT_REQUIRED || | |
| 152 requirement == AutoEnrollmentController::EXPLICITLY_NOT_REQUIRED) { | |
| 153 accel_map_[ui::Accelerator(ui::VKEY_R, | |
| 154 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | | |
| 155 ui::EF_SHIFT_DOWN)] = kAccelNameReset; | |
| 156 } | |
| 157 | |
| 147 accel_map_[ui::Accelerator(ui::VKEY_X, | 158 accel_map_[ui::Accelerator(ui::VKEY_X, |
| 148 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] = | 159 ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] = |
| 149 kAccelNameEnableDebugging; | 160 kAccelNameEnableDebugging; |
| 150 accel_map_[ui::Accelerator( | 161 accel_map_[ui::Accelerator( |
| 151 ui::VKEY_B, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] = | 162 ui::VKEY_B, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] = |
| 152 kAccelNameToggleEasyBootstrap; | 163 kAccelNameToggleEasyBootstrap; |
| 153 | 164 |
| 154 accel_map_[ui::Accelerator( | 165 accel_map_[ui::Accelerator( |
| 155 ui::VKEY_D, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] = | 166 ui::VKEY_D, ui::EF_CONTROL_DOWN | ui::EF_ALT_DOWN | ui::EF_SHIFT_DOWN)] = |
| 156 kAccelNameDeviceRequisition; | 167 kAccelNameDeviceRequisition; |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 569 if (should_emit_login_prompt_visible_) { | 580 if (should_emit_login_prompt_visible_) { |
| 570 VLOG(1) << "Login WebUI >> login-prompt-visible"; | 581 VLOG(1) << "Login WebUI >> login-prompt-visible"; |
| 571 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> | 582 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> |
| 572 EmitLoginPromptVisible(); | 583 EmitLoginPromptVisible(); |
| 573 } | 584 } |
| 574 | 585 |
| 575 webui_visible_ = true; | 586 webui_visible_ = true; |
| 576 } | 587 } |
| 577 | 588 |
| 578 } // namespace chromeos | 589 } // namespace chromeos |
| OLD | NEW |