Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(703)

Unified Diff: chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc

Issue 2300943002: arc: Support more orientation lock types. (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/arc/common/app.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
index 9d36b0ffecbbc5fcca4fdc215e38211c2f9d5d1c..c110d1c8ffc0adddda3cf99530196b2d041d44ed 100644
--- a/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.cc
@@ -54,11 +54,13 @@ arc::mojom::OrientationLock GetCurrentOrientation() {
// landscape (ROTATE_0 == landscape).
switch (internal_display.rotation()) {
case display::Display::ROTATE_0:
- case display::Display::ROTATE_180:
- return arc::mojom::OrientationLock::LANDSCAPE;
+ return arc::mojom::OrientationLock::LANDSCAPE_PRIMARY;
case display::Display::ROTATE_90:
+ return arc::mojom::OrientationLock::PORTRAIT_PRIMARY;
+ case display::Display::ROTATE_180:
+ return arc::mojom::OrientationLock::LANDSCAPE_SECONDARY;
case display::Display::ROTATE_270:
- return arc::mojom::OrientationLock::PORTRAIT;
+ return arc::mojom::OrientationLock::PORTRAIT_SECONDARY;
}
return arc::mojom::OrientationLock::NONE;
}
@@ -66,12 +68,21 @@ arc::mojom::OrientationLock GetCurrentOrientation() {
blink::WebScreenOrientationLockType BlinkOrientationLockFromMojom(
arc::mojom::OrientationLock orientation_lock) {
DCHECK_NE(arc::mojom::OrientationLock::CURRENT, orientation_lock);
- if (orientation_lock == arc::mojom::OrientationLock::PORTRAIT) {
- return blink::WebScreenOrientationLockPortrait;
- } else if (orientation_lock == arc::mojom::OrientationLock::LANDSCAPE) {
- return blink::WebScreenOrientationLockLandscape;
- } else {
- return blink::WebScreenOrientationLockAny;
+ switch (orientation_lock) {
+ case arc::mojom::OrientationLock::PORTRAIT:
+ return blink::WebScreenOrientationLockPortrait;
+ case arc::mojom::OrientationLock::LANDSCAPE:
+ return blink::WebScreenOrientationLockLandscape;
+ case arc::mojom::OrientationLock::PORTRAIT_PRIMARY:
+ return blink::WebScreenOrientationLockPortraitPrimary;
+ case arc::mojom::OrientationLock::LANDSCAPE_PRIMARY:
+ return blink::WebScreenOrientationLockLandscapePrimary;
+ case arc::mojom::OrientationLock::PORTRAIT_SECONDARY:
+ return blink::WebScreenOrientationLockPortraitSecondary;
+ case arc::mojom::OrientationLock::LANDSCAPE_SECONDARY:
+ return blink::WebScreenOrientationLockLandscapeSecondary;
+ default:
+ return blink::WebScreenOrientationLockAny;
}
}
« no previous file with comments | « no previous file | components/arc/common/app.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698