screen_orientation_controller_test_api.cc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #include "ash/display/screen_orientation_controller_test_api.h"
  5. #include "ash/display/screen_orientation_controller.h"
  6. namespace ash {
  7. ScreenOrientationControllerTestApi::ScreenOrientationControllerTestApi(
  8. ScreenOrientationController* controller)
  9. : controller_(controller) {}
  10. void ScreenOrientationControllerTestApi::SetDisplayRotation(
  11. display::Display::Rotation rotation,
  12. display::Display::RotationSource source,
  13. DisplayConfigurationController::RotationAnimation mode) {
  14. controller_->SetDisplayRotation(rotation, source, mode);
  15. }
  16. void ScreenOrientationControllerTestApi::SetRotationLocked(bool locked) {
  17. controller_->SetRotationLockedInternal(locked);
  18. }
  19. chromeos::OrientationType
  20. ScreenOrientationControllerTestApi::UserLockedOrientation() const {
  21. return controller_->user_locked_orientation_;
  22. }
  23. chromeos::OrientationType
  24. ScreenOrientationControllerTestApi::GetCurrentOrientation() const {
  25. return controller_->GetCurrentOrientation();
  26. }
  27. void ScreenOrientationControllerTestApi::UpdateNaturalOrientation() {
  28. controller_->UpdateNaturalOrientationForTest();
  29. }
  30. bool ScreenOrientationControllerTestApi::IsAutoRotationAllowed() const {
  31. return controller_->IsAutoRotationAllowed();
  32. }
  33. } // namespace ash