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 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.content.pm.ActivityInfo; | 8 import android.content.pm.ActivityInfo; |
| 9 import android.content.pm.PackageManager; | 9 import android.content.pm.PackageManager; |
| 10 import android.util.Log; | |
| 11 | 10 |
| 12 import org.chromium.base.ApplicationStatus; | 11 import org.chromium.base.ApplicationStatus; |
| 13 import org.chromium.base.CalledByNative; | 12 import org.chromium.base.CalledByNative; |
| 14 import org.chromium.base.JNINamespace; | 13 import org.chromium.base.JNINamespace; |
| 14 import org.chromium.base.Log; | |
| 15 import org.chromium.base.ThreadUtils; | 15 import org.chromium.base.ThreadUtils; |
| 16 import org.chromium.content_public.common.ScreenOrientationConstants; | 16 import org.chromium.content_public.common.ScreenOrientationConstants; |
| 17 import org.chromium.content_public.common.ScreenOrientationValues; | 17 import org.chromium.content_public.common.ScreenOrientationValues; |
| 18 import org.chromium.ui.gfx.DeviceDisplayInfo; | 18 import org.chromium.ui.gfx.DeviceDisplayInfo; |
| 19 | 19 |
| 20 /** | 20 /** |
| 21 * This is the implementation of the C++ counterpart ScreenOrientationProvider. | 21 * This is the implementation of the C++ counterpart ScreenOrientationProvider. |
| 22 */ | 22 */ |
| 23 @JNINamespace("content") | 23 @JNINamespace("content") |
| 24 public class ScreenOrientationProvider { | 24 public class ScreenOrientationProvider { |
| 25 private static final String TAG = "ScreenOrientationProvider"; | 25 private static final String TAG = "cr.ScreenOrientation"; |
|
AKVT
2015/06/16 08:48:54
cr.ScreenOrientationProvider
| |
| 26 | 26 |
| 27 private static int getOrientationFromWebScreenOrientations(byte orientation, | 27 private static int getOrientationFromWebScreenOrientations(byte orientation, |
| 28 Activity activity) { | 28 Activity activity) { |
| 29 switch (orientation) { | 29 switch (orientation) { |
| 30 case ScreenOrientationValues.DEFAULT: | 30 case ScreenOrientationValues.DEFAULT: |
| 31 return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; | 31 return ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED; |
| 32 case ScreenOrientationValues.PORTRAIT_PRIMARY: | 32 case ScreenOrientationValues.PORTRAIT_PRIMARY: |
| 33 return ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; | 33 return ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; |
| 34 case ScreenOrientationValues.PORTRAIT_SECONDARY: | 34 case ScreenOrientationValues.PORTRAIT_SECONDARY: |
| 35 return ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT; | 35 return ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 @Override | 125 @Override |
| 126 public void run() { | 126 public void run() { |
| 127 ScreenOrientationListener.getInstance().stopAccurateListening(); | 127 ScreenOrientationListener.getInstance().stopAccurateListening(); |
| 128 } | 128 } |
| 129 }); | 129 }); |
| 130 } | 130 } |
| 131 | 131 |
| 132 private ScreenOrientationProvider() { | 132 private ScreenOrientationProvider() { |
| 133 } | 133 } |
| 134 } | 134 } |
| OLD | NEW |