Chromium Code Reviews| Index: remoting/android/java/src/org/chromium/chromoting/Desktop.java |
| diff --git a/remoting/android/java/src/org/chromium/chromoting/Desktop.java b/remoting/android/java/src/org/chromium/chromoting/Desktop.java |
| index ebc7ad6c3427bbd8c554d210ed860d15aa853a97..4d224d6930192a9268cf025fd4e8577ef59f6a55 100644 |
| --- a/remoting/android/java/src/org/chromium/chromoting/Desktop.java |
| +++ b/remoting/android/java/src/org/chromium/chromoting/Desktop.java |
| @@ -62,8 +62,8 @@ public class Desktop |
| /** The amount of time to wait to hide the ActionBar after user input is seen. */ |
| private static final int ACTIONBAR_AUTO_HIDE_DELAY_MS = 3000; |
| - private final Event.Raisable<SoftInputMethodVisibilityChangedEventParameter> |
| - mOnSoftInputMethodVisibilityChanged = new Event.Raisable<>(); |
| + private final Event.Raisable<SystemUiVisibilityChangedEventParameter> |
| + mOnSystemUiVisibilityChanged = new Event.Raisable<>(); |
| private final Event.Raisable<InputModeChangedEventParameter> mOnInputModeChanged = |
| new Event.Raisable<>(); |
| @@ -253,9 +253,8 @@ public class Desktop |
| return super.onCreateOptionsMenu(menu); |
| } |
| - public Event<SoftInputMethodVisibilityChangedEventParameter> |
| - onSoftInputMethodVisibilityChanged() { |
| - return mOnSoftInputMethodVisibilityChanged; |
| + public Event<SystemUiVisibilityChangedEventParameter> onSystemUiVisibilityChanged() { |
| + return mOnSystemUiVisibilityChanged; |
| } |
| public Event<InputModeChangedEventParameter> onInputModeChanged() { |
| @@ -372,6 +371,10 @@ public class Desktop |
| return getSupportActionBar() != null && getSupportActionBar().isShowing(); |
| } |
| + private boolean isSystemUiVisible() { |
| + return ((getWindow().getDecorView().getSystemUiVisibility() & getFullscreenFlags()) == 0); |
|
Lambros
2016/06/29 20:43:36
Remove outermost parentheses.
joedow
2016/06/30 16:03:26
Done.
|
| + } |
| + |
| /** Called whenever the visibility of the system status bar or navigation bar changes. */ |
| @Override |
| public void onSystemUiVisibilityChange(int visibility) { |
| @@ -541,9 +544,8 @@ public class Desktop |
| // whenever they occur. |
| boolean oldSoftInputVisible = mSoftInputVisible; |
| mSoftInputVisible = (bottom < mMaxBottomValue); |
| - mOnSoftInputMethodVisibilityChanged.raise( |
| - new SoftInputMethodVisibilityChangedEventParameter( |
| - mSoftInputVisible, left, top, right, bottom)); |
| + mOnSystemUiVisibilityChanged.raise(new SystemUiVisibilityChangedEventParameter( |
| + isSystemUiVisible(), mSoftInputVisible, left, top, right, bottom)); |
| boolean softInputVisibilityChanged = oldSoftInputVisible != mSoftInputVisible; |
| if (!mSoftInputVisible && softInputVisibilityChanged && !isActionBarVisible()) { |