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.chrome.browser.fullscreen; | 5 package org.chromium.chrome.browser.fullscreen; |
6 | 6 |
7 import static android.view.View.SYSTEM_UI_FLAG_FULLSCREEN; | 7 import static android.view.View.SYSTEM_UI_FLAG_FULLSCREEN; |
8 import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; | 8 import static android.view.View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN; |
9 import static android.view.View.SYSTEM_UI_FLAG_LOW_PROFILE; | 9 import static android.view.View.SYSTEM_UI_FLAG_LOW_PROFILE; |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 contentView.addOnLayoutChangeListener(new OnLayoutChangeList
ener() { | 131 contentView.addOnLayoutChangeListener(new OnLayoutChangeList
ener() { |
132 @Override | 132 @Override |
133 public void onLayoutChange(View v, int left, int top, in
t right, | 133 public void onLayoutChange(View v, int left, int top, in
t right, |
134 int bottom, int oldLeft, int oldTop, int oldRigh
t, | 134 int bottom, int oldLeft, int oldTop, int oldRigh
t, |
135 int oldBottom) { | 135 int oldBottom) { |
136 sendEmptyMessageDelayed(MSG_ID_CLEAR_LAYOUT_FULLSCRE
EN_FLAG, | 136 sendEmptyMessageDelayed(MSG_ID_CLEAR_LAYOUT_FULLSCRE
EN_FLAG, |
137 CLEAR_LAYOUT_FULLSCREEN_DELAY_MS); | 137 CLEAR_LAYOUT_FULLSCREEN_DELAY_MS); |
138 contentView.removeOnLayoutChangeListener(this); | 138 contentView.removeOnLayoutChangeListener(this); |
139 } | 139 } |
140 }); | 140 }); |
| 141 |
| 142 contentView.requestLayout(); |
141 break; | 143 break; |
142 } | 144 } |
143 case MSG_ID_CLEAR_LAYOUT_FULLSCREEN_FLAG: { | 145 case MSG_ID_CLEAR_LAYOUT_FULLSCREEN_FLAG: { |
144 // Change this assert to simply ignoring the message to work
around | 146 // Change this assert to simply ignoring the message to work
around |
145 // http://crbug/365638 | 147 // http://crbug/365638 |
146 // TODO(aberent): Fix bug | 148 // TODO(aberent): Fix bug |
147 // assert mIsPersistentMode : "Calling after we exited fulls
creen"; | 149 // assert mIsPersistentMode : "Calling after we exited fulls
creen"; |
148 if (!fullscreenHtmlApiHandler.getPersistentFullscreenMode())
return; | 150 if (!fullscreenHtmlApiHandler.getPersistentFullscreenMode())
return; |
149 final ContentViewCore contentViewCore = | 151 final ContentViewCore contentViewCore = |
150 fullscreenHtmlApiHandler.mContentViewCoreInFullscree
n; | 152 fullscreenHtmlApiHandler.mContentViewCoreInFullscree
n; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 if (mDelegate.shouldShowNotificationToast()) { | 294 if (mDelegate.shouldShowNotificationToast()) { |
293 showNotificationToast(); | 295 showNotificationToast(); |
294 } | 296 } |
295 contentView.removeOnLayoutChangeListener(this); | 297 contentView.removeOnLayoutChangeListener(this); |
296 } | 298 } |
297 }; | 299 }; |
298 contentView.addOnLayoutChangeListener(mFullscreenOnLayoutChangeListener)
; | 300 contentView.addOnLayoutChangeListener(mFullscreenOnLayoutChangeListener)
; |
299 contentView.setSystemUiVisibility(systemUiVisibility); | 301 contentView.setSystemUiVisibility(systemUiVisibility); |
300 | 302 |
301 // Request a layout so the updated system visibility takes affect. | 303 // Request a layout so the updated system visibility takes affect. |
302 contentView.getRootView().requestLayout(); | 304 contentView.requestLayout(); |
303 | 305 |
304 mContentViewCoreInFullscreen = contentViewCore; | 306 mContentViewCoreInFullscreen = contentViewCore; |
305 mTabInFullscreen = tab; | 307 mTabInFullscreen = tab; |
306 } | 308 } |
307 | 309 |
308 /** | 310 /** |
309 * Create and show the fullscreen notification toast. | 311 * Create and show the fullscreen notification toast. |
310 */ | 312 */ |
311 private void showNotificationToast() { | 313 private void showNotificationToast() { |
312 if (mNotificationToast == null) { | 314 if (mNotificationToast == null) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 private static int getExtraFullscreenUIFlags() { | 366 private static int getExtraFullscreenUIFlags() { |
365 int flags = 0; | 367 int flags = 0; |
366 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | 368 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { |
367 flags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; | 369 flags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; |
368 flags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; | 370 flags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; |
369 flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; | 371 flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; |
370 } | 372 } |
371 return flags; | 373 return flags; |
372 } | 374 } |
373 } | 375 } |
OLD | NEW |