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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 // SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN does not always trigger a vi
ew-level layout | 284 // SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN does not always trigger a vi
ew-level layout |
285 // with an updated height. To work around this, do not check fo
r an increased | 285 // with an updated height. To work around this, do not check fo
r an increased |
286 // height and always just trigger the next step of the fullscree
n initialization. | 286 // height and always just trigger the next step of the fullscree
n initialization. |
287 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2)
{ | 287 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2)
{ |
288 // Posting the message to set the fullscreen flag because se
tting it | 288 // Posting the message to set the fullscreen flag because se
tting it |
289 // directly in the onLayoutChange would have no effect. | 289 // directly in the onLayoutChange would have no effect. |
290 mHandler.sendEmptyMessage(MSG_ID_SET_FULLSCREEN_SYSTEM_UI_FL
AGS); | 290 mHandler.sendEmptyMessage(MSG_ID_SET_FULLSCREEN_SYSTEM_UI_FL
AGS); |
291 } | 291 } |
292 | 292 |
293 if ((bottom - top) <= (oldBottom - oldTop)) return; | 293 if ((bottom - top) <= (oldBottom - oldTop)) return; |
294 if (mDelegate.shouldShowNotificationToast()) { | 294 if (mDelegate.shouldShowNotificationToast() |
| 295 && !tab.getEmbeddedMediaExperienceEnabled()) { |
295 showNotificationToast(); | 296 showNotificationToast(); |
296 } | 297 } |
297 contentView.removeOnLayoutChangeListener(this); | 298 contentView.removeOnLayoutChangeListener(this); |
298 } | 299 } |
299 }; | 300 }; |
300 contentView.addOnLayoutChangeListener(mFullscreenOnLayoutChangeListener)
; | 301 contentView.addOnLayoutChangeListener(mFullscreenOnLayoutChangeListener)
; |
301 contentView.setSystemUiVisibility(systemUiVisibility); | 302 contentView.setSystemUiVisibility(systemUiVisibility); |
302 | 303 |
303 // Request a layout so the updated system visibility takes affect. | 304 // Request a layout so the updated system visibility takes affect. |
304 contentView.requestLayout(); | 305 contentView.requestLayout(); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 private static int getExtraFullscreenUIFlags() { | 367 private static int getExtraFullscreenUIFlags() { |
367 int flags = 0; | 368 int flags = 0; |
368 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | 369 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { |
369 flags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; | 370 flags |= View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION; |
370 flags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; | 371 flags |= View.SYSTEM_UI_FLAG_HIDE_NAVIGATION; |
371 flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; | 372 flags |= View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY; |
372 } | 373 } |
373 return flags; | 374 return flags; |
374 } | 375 } |
375 } | 376 } |
OLD | NEW |