| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/webui/chromeos/login/core_oobe_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h" |
| 6 | 6 |
| 7 #include <type_traits> | 7 #include <type_traits> |
| 8 | 8 |
| 9 #include "ash/common/accessibility_types.h" | 9 #include "ash/common/accessibility_types.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 } // namespace | 52 } // namespace |
| 53 | 53 |
| 54 namespace chromeos { | 54 namespace chromeos { |
| 55 | 55 |
| 56 // Note that show_oobe_ui_ defaults to false because WizardController assumes | 56 // Note that show_oobe_ui_ defaults to false because WizardController assumes |
| 57 // OOBE UI is not visible by default. | 57 // OOBE UI is not visible by default. |
| 58 CoreOobeHandler::CoreOobeHandler(OobeUI* oobe_ui) | 58 CoreOobeHandler::CoreOobeHandler(OobeUI* oobe_ui) |
| 59 : oobe_ui_(oobe_ui), version_info_updater_(this) { | 59 : oobe_ui_(oobe_ui), version_info_updater_(this) { |
| 60 set_call_js_prefix(kJsScreenPath); | 60 set_call_js_prefix(kJsScreenPath); |
| 61 if (!chrome::IsRunningInMash()) { | 61 if (!ash_util::IsRunningInMash()) { |
| 62 AccessibilityManager* accessibility_manager = AccessibilityManager::Get(); | 62 AccessibilityManager* accessibility_manager = AccessibilityManager::Get(); |
| 63 CHECK(accessibility_manager); | 63 CHECK(accessibility_manager); |
| 64 accessibility_subscription_ = accessibility_manager->RegisterCallback( | 64 accessibility_subscription_ = accessibility_manager->RegisterCallback( |
| 65 base::Bind(&CoreOobeHandler::OnAccessibilityStatusChanged, | 65 base::Bind(&CoreOobeHandler::OnAccessibilityStatusChanged, |
| 66 base::Unretained(this))); | 66 base::Unretained(this))); |
| 67 } else { | 67 } else { |
| 68 NOTIMPLEMENTED(); | 68 NOTIMPLEMENTED(); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 if (controller) | 307 if (controller) |
| 308 controller->SkipUpdateEnrollAfterEula(); | 308 controller->SkipUpdateEnrollAfterEula(); |
| 309 } | 309 } |
| 310 | 310 |
| 311 void CoreOobeHandler::HandleUpdateCurrentScreen( | 311 void CoreOobeHandler::HandleUpdateCurrentScreen( |
| 312 const std::string& screen_name) { | 312 const std::string& screen_name) { |
| 313 const OobeScreen screen = GetOobeScreenFromName(screen_name); | 313 const OobeScreen screen = GetOobeScreenFromName(screen_name); |
| 314 if (delegate_) | 314 if (delegate_) |
| 315 delegate_->OnCurrentScreenChanged(screen); | 315 delegate_->OnCurrentScreenChanged(screen); |
| 316 // TODO(mash): Support EventRewriterController; see crbug.com/647781 | 316 // TODO(mash): Support EventRewriterController; see crbug.com/647781 |
| 317 if (!chrome::IsRunningInMash()) { | 317 if (!ash_util::IsRunningInMash()) { |
| 318 KeyboardDrivenEventRewriter::GetInstance()->SetArrowToTabRewritingEnabled( | 318 KeyboardDrivenEventRewriter::GetInstance()->SetArrowToTabRewritingEnabled( |
| 319 screen == OobeScreen::SCREEN_OOBE_EULA); | 319 screen == OobeScreen::SCREEN_OOBE_EULA); |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 | 322 |
| 323 void CoreOobeHandler::HandleEnableHighContrast(bool enabled) { | 323 void CoreOobeHandler::HandleEnableHighContrast(bool enabled) { |
| 324 AccessibilityManager::Get()->EnableHighContrast(enabled); | 324 AccessibilityManager::Get()->EnableHighContrast(enabled); |
| 325 } | 325 } |
| 326 | 326 |
| 327 void CoreOobeHandler::HandleEnableLargeCursor(bool enabled) { | 327 void CoreOobeHandler::HandleEnableLargeCursor(bool enabled) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 if (page_is_ready()) | 392 if (page_is_ready()) |
| 393 UpdateOobeUIVisibility(); | 393 UpdateOobeUIVisibility(); |
| 394 } | 394 } |
| 395 | 395 |
| 396 void CoreOobeHandler::UpdateShutdownAndRebootVisibility( | 396 void CoreOobeHandler::UpdateShutdownAndRebootVisibility( |
| 397 bool reboot_on_shutdown) { | 397 bool reboot_on_shutdown) { |
| 398 CallJSOrDefer("showShutdown", !reboot_on_shutdown); | 398 CallJSOrDefer("showShutdown", !reboot_on_shutdown); |
| 399 } | 399 } |
| 400 | 400 |
| 401 void CoreOobeHandler::UpdateA11yState() { | 401 void CoreOobeHandler::UpdateA11yState() { |
| 402 if (chrome::IsRunningInMash()) { | 402 if (ash_util::IsRunningInMash()) { |
| 403 NOTIMPLEMENTED(); | 403 NOTIMPLEMENTED(); |
| 404 return; | 404 return; |
| 405 } | 405 } |
| 406 // TODO(dpolukhin): crbug.com/412891 | 406 // TODO(dpolukhin): crbug.com/412891 |
| 407 DCHECK(MagnificationManager::Get()); | 407 DCHECK(MagnificationManager::Get()); |
| 408 base::DictionaryValue a11y_info; | 408 base::DictionaryValue a11y_info; |
| 409 a11y_info.SetBoolean("highContrastEnabled", | 409 a11y_info.SetBoolean("highContrastEnabled", |
| 410 AccessibilityManager::Get()->IsHighContrastEnabled()); | 410 AccessibilityManager::Get()->IsHighContrastEnabled()); |
| 411 a11y_info.SetBoolean("largeCursorEnabled", | 411 a11y_info.SetBoolean("largeCursorEnabled", |
| 412 AccessibilityManager::Get()->IsLargeCursorEnabled()); | 412 AccessibilityManager::Get()->IsLargeCursorEnabled()); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 | 526 |
| 527 void CoreOobeHandler::InitDemoModeDetection() { | 527 void CoreOobeHandler::InitDemoModeDetection() { |
| 528 demo_mode_detector_.InitDetection(); | 528 demo_mode_detector_.InitDetection(); |
| 529 } | 529 } |
| 530 | 530 |
| 531 void CoreOobeHandler::StopDemoModeDetection() { | 531 void CoreOobeHandler::StopDemoModeDetection() { |
| 532 demo_mode_detector_.StopDetection(); | 532 demo_mode_detector_.StopDetection(); |
| 533 } | 533 } |
| 534 | 534 |
| 535 } // namespace chromeos | 535 } // namespace chromeos |
| OLD | NEW |