| Index: ui/display/display.cc
|
| diff --git a/ui/display/display.cc b/ui/display/display.cc
|
| index 25573f8f9b90e3408ab9234162a0a9b0c92aae70..3255fbf3555cf8061bfe79402e274d5d084a0b6d 100644
|
| --- a/ui/display/display.cc
|
| +++ b/ui/display/display.cc
|
| @@ -115,18 +115,7 @@ Display::Display(const Display& other) = default;
|
| Display::~Display() {}
|
|
|
| int Display::RotationAsDegree() const {
|
| - switch (rotation_) {
|
| - case ROTATE_0:
|
| - return 0;
|
| - case ROTATE_90:
|
| - return 90;
|
| - case ROTATE_180:
|
| - return 180;
|
| - case ROTATE_270:
|
| - return 270;
|
| - }
|
| - NOTREACHED();
|
| - return 0;
|
| + return RotateToDegree(rotation_);
|
| }
|
|
|
| void Display::SetRotationAsDegree(int rotation) {
|
| @@ -231,4 +220,20 @@ bool Display::HasInternalDisplay() {
|
| return internal_display_id_ != kInvalidDisplayId;
|
| }
|
|
|
| +// static
|
| +int Display::RotateToDegree(Rotation rotation) {
|
| + switch (rotation) {
|
| + case ROTATE_0:
|
| + return 0;
|
| + case ROTATE_90:
|
| + return 90;
|
| + case ROTATE_180:
|
| + return 180;
|
| + case ROTATE_270:
|
| + return 270;
|
| + }
|
| + NOTREACHED();
|
| + return 0;
|
| +}
|
| +
|
| } // namespace display
|
|
|