| 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 android.animation.Animator; | 7 import android.animation.Animator; |
| 8 import android.animation.AnimatorListenerAdapter; | 8 import android.animation.AnimatorListenerAdapter; |
| 9 import android.animation.ObjectAnimator; | 9 import android.animation.ObjectAnimator; |
| 10 import android.app.Activity; | 10 import android.app.Activity; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 import org.chromium.base.VisibleForTesting; | 31 import org.chromium.base.VisibleForTesting; |
| 32 import org.chromium.base.library_loader.LibraryLoader; | 32 import org.chromium.base.library_loader.LibraryLoader; |
| 33 import org.chromium.chrome.browser.fullscreen.FullscreenHtmlApiHandler.Fullscree
nHtmlApiDelegate; | 33 import org.chromium.chrome.browser.fullscreen.FullscreenHtmlApiHandler.Fullscree
nHtmlApiDelegate; |
| 34 import org.chromium.chrome.browser.tab.Tab; | 34 import org.chromium.chrome.browser.tab.Tab; |
| 35 import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType; | 35 import org.chromium.chrome.browser.tabmodel.TabModel.TabSelectionType; |
| 36 import org.chromium.chrome.browser.tabmodel.TabModelSelector; | 36 import org.chromium.chrome.browser.tabmodel.TabModelSelector; |
| 37 import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabModelObserver; | 37 import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabModelObserver; |
| 38 import org.chromium.chrome.browser.widget.ControlContainer; | 38 import org.chromium.chrome.browser.widget.ControlContainer; |
| 39 import org.chromium.content.browser.ContentVideoView; | 39 import org.chromium.content.browser.ContentVideoView; |
| 40 import org.chromium.content.browser.ContentViewCore; | 40 import org.chromium.content.browser.ContentViewCore; |
| 41 import org.chromium.content_public.common.TopControlsState; | 41 import org.chromium.content_public.common.BrowserControlsState; |
| 42 | 42 |
| 43 import java.lang.ref.WeakReference; | 43 import java.lang.ref.WeakReference; |
| 44 import java.util.ArrayList; | 44 import java.util.ArrayList; |
| 45 import java.util.HashSet; | 45 import java.util.HashSet; |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * A class that manages control and content views to create the fullscreen mode. | 48 * A class that manages control and content views to create the fullscreen mode. |
| 49 */ | 49 */ |
| 50 public class ChromeFullscreenManager | 50 public class ChromeFullscreenManager |
| 51 extends FullscreenManager implements ActivityStateListener, WindowFocusC
hangedListener { | 51 extends FullscreenManager implements ActivityStateListener, WindowFocusC
hangedListener { |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 private int mPersistentControlsCurrentToken; | 86 private int mPersistentControlsCurrentToken; |
| 87 private long mCurrentShowTime; | 87 private long mCurrentShowTime; |
| 88 private int mActivityShowToken = INVALID_TOKEN; | 88 private int mActivityShowToken = INVALID_TOKEN; |
| 89 | 89 |
| 90 private ObjectAnimator mControlAnimation; | 90 private ObjectAnimator mControlAnimation; |
| 91 private boolean mCurrentAnimationIsShowing; | 91 private boolean mCurrentAnimationIsShowing; |
| 92 | 92 |
| 93 private boolean mDisableBrowserOverride; | 93 private boolean mDisableBrowserOverride; |
| 94 | 94 |
| 95 private boolean mTopControlsPermanentlyHidden; | 95 private boolean mBrowserControlsPermanentlyHidden; |
| 96 private boolean mTopControlsAndroidViewHidden; | 96 private boolean mBrowserControlsAndroidViewHidden; |
| 97 private final boolean mSupportsBrowserOverride; | 97 private final boolean mSupportsBrowserOverride; |
| 98 | 98 |
| 99 private final ArrayList<FullscreenListener> mListeners = new ArrayList<Fulls
creenListener>(); | 99 private final ArrayList<FullscreenListener> mListeners = new ArrayList<Fulls
creenListener>(); |
| 100 | 100 |
| 101 /** | 101 /** |
| 102 * A listener that gets notified of changes to the fullscreen state. | 102 * A listener that gets notified of changes to the fullscreen state. |
| 103 */ | 103 */ |
| 104 public interface FullscreenListener { | 104 public interface FullscreenListener { |
| 105 /** | 105 /** |
| 106 * Called whenever the content's offset changes. | 106 * Called whenever the content's offset changes. |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 } | 268 } |
| 269 } | 269 } |
| 270 | 270 |
| 271 @Override | 271 @Override |
| 272 protected FullscreenHtmlApiDelegate createApiDelegate() { | 272 protected FullscreenHtmlApiDelegate createApiDelegate() { |
| 273 return new FullscreenHtmlApiDelegate() { | 273 return new FullscreenHtmlApiDelegate() { |
| 274 @Override | 274 @Override |
| 275 public void onEnterFullscreen() { | 275 public void onEnterFullscreen() { |
| 276 Tab tab = getTab(); | 276 Tab tab = getTab(); |
| 277 if (getControlOffset() == -mControlContainerHeight) { | 277 if (getControlOffset() == -mControlContainerHeight) { |
| 278 // The top controls are currently hidden. | 278 // The browser controls are currently hidden. |
| 279 getHtmlApiHandler().enterFullscreen(tab); | 279 getHtmlApiHandler().enterFullscreen(tab); |
| 280 } else { | 280 } else { |
| 281 // We should hide top controls first. | 281 // We should hide browser controls first. |
| 282 mIsEnteringPersistentModeState = true; | 282 mIsEnteringPersistentModeState = true; |
| 283 tab.updateFullscreenEnabledState(); | 283 tab.updateFullscreenEnabledState(); |
| 284 } | 284 } |
| 285 } | 285 } |
| 286 | 286 |
| 287 @Override | 287 @Override |
| 288 public boolean cancelPendingEnterFullscreen() { | 288 public boolean cancelPendingEnterFullscreen() { |
| 289 boolean wasPending = mIsEnteringPersistentModeState; | 289 boolean wasPending = mIsEnteringPersistentModeState; |
| 290 mIsEnteringPersistentModeState = false; | 290 mIsEnteringPersistentModeState = false; |
| 291 return wasPending; | 291 return wasPending; |
| 292 } | 292 } |
| 293 | 293 |
| 294 @Override | 294 @Override |
| 295 public void onFullscreenExited(Tab tab) { | 295 public void onFullscreenExited(Tab tab) { |
| 296 // At this point, top controls are hidden. Show top controls onl
y if it's | 296 // At this point, browser controls are hidden. Show browser cont
rols only if it's |
| 297 // permitted. | 297 // permitted. |
| 298 tab.updateTopControlsState(TopControlsState.SHOWN, true); | 298 tab.updateBrowserControlsState(BrowserControlsState.SHOWN, true)
; |
| 299 } | 299 } |
| 300 | 300 |
| 301 @Override | 301 @Override |
| 302 public boolean shouldShowNotificationToast() { | 302 public boolean shouldShowNotificationToast() { |
| 303 return !isOverlayVideoMode(); | 303 return !isOverlayVideoMode(); |
| 304 } | 304 } |
| 305 }; | 305 }; |
| 306 } | 306 } |
| 307 | 307 |
| 308 /** | 308 /** |
| 309 * Disables the ability for the browser to override the renderer provided to
p controls | 309 * Disables the ability for the browser to override the renderer provided br
owser controls |
| 310 * position for testing. | 310 * position for testing. |
| 311 */ | 311 */ |
| 312 @VisibleForTesting | 312 @VisibleForTesting |
| 313 public void disableBrowserOverrideForTest() { | 313 public void disableBrowserOverrideForTest() { |
| 314 ThreadUtils.assertOnUiThread(); | 314 ThreadUtils.assertOnUiThread(); |
| 315 | 315 |
| 316 mDisableBrowserOverride = true; | 316 mDisableBrowserOverride = true; |
| 317 mPersistentControlTokens.clear(); | 317 mPersistentControlTokens.clear(); |
| 318 mHandler.removeMessages(MSG_ID_HIDE_CONTROLS); | 318 mHandler.removeMessages(MSG_ID_HIDE_CONTROLS); |
| 319 if (mControlAnimation != null) { | 319 if (mControlAnimation != null) { |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 public void hideControlsPersistent(int token) { | 361 public void hideControlsPersistent(int token) { |
| 362 if (!mSupportsBrowserOverride) return; | 362 if (!mSupportsBrowserOverride) return; |
| 363 if (mPersistentControlTokens.remove(token) && mPersistentControlTokens.i
sEmpty()) { | 363 if (mPersistentControlTokens.remove(token) && mPersistentControlTokens.i
sEmpty()) { |
| 364 update(false); | 364 update(false); |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 | 367 |
| 368 /** | 368 /** |
| 369 * @param remove Whether or not to forcefully remove the toolbar. | 369 * @param remove Whether or not to forcefully remove the toolbar. |
| 370 */ | 370 */ |
| 371 public void setTopControlsPermamentlyHidden(boolean remove) { | 371 public void setBrowserControlsPermamentlyHidden(boolean remove) { |
| 372 if (remove == mTopControlsPermanentlyHidden) return; | 372 if (remove == mBrowserControlsPermanentlyHidden) return; |
| 373 mTopControlsPermanentlyHidden = remove; | 373 mBrowserControlsPermanentlyHidden = remove; |
| 374 updateVisuals(); | 374 updateVisuals(); |
| 375 } | 375 } |
| 376 | 376 |
| 377 /** | 377 /** |
| 378 * @return Whether or not the toolbar is forcefully being removed. | 378 * @return Whether or not the toolbar is forcefully being removed. |
| 379 */ | 379 */ |
| 380 public boolean areTopControlsPermanentlyHidden() { | 380 public boolean areBrowserControlsPermanentlyHidden() { |
| 381 return mTopControlsPermanentlyHidden; | 381 return mBrowserControlsPermanentlyHidden; |
| 382 } | 382 } |
| 383 | 383 |
| 384 /** | 384 /** |
| 385 * @return Whether the top controls should be drawn as a texture. | 385 * @return Whether the browser controls should be drawn as a texture. |
| 386 */ | 386 */ |
| 387 public boolean drawControlsAsTexture() { | 387 public boolean drawControlsAsTexture() { |
| 388 return getControlOffset() > -mControlContainerHeight; | 388 return getControlOffset() > -mControlContainerHeight; |
| 389 } | 389 } |
| 390 | 390 |
| 391 @Override | 391 @Override |
| 392 public int getTopControlsHeight() { | 392 public int getBrowserControlsHeight() { |
| 393 return mControlContainerHeight; | 393 return mControlContainerHeight; |
| 394 } | 394 } |
| 395 | 395 |
| 396 @Override | 396 @Override |
| 397 public float getContentOffset() { | 397 public float getContentOffset() { |
| 398 if (mTopControlsPermanentlyHidden) return 0; | 398 if (mBrowserControlsPermanentlyHidden) return 0; |
| 399 return rendererContentOffset(); | 399 return rendererContentOffset(); |
| 400 } | 400 } |
| 401 | 401 |
| 402 /** | 402 /** |
| 403 * @return The offset of the controls from the top of the screen. | 403 * @return The offset of the controls from the top of the screen. |
| 404 */ | 404 */ |
| 405 public float getControlOffset() { | 405 public float getControlOffset() { |
| 406 if (mTopControlsPermanentlyHidden) return -getTopControlsHeight(); | 406 if (mBrowserControlsPermanentlyHidden) return -getBrowserControlsHeight(
); |
| 407 return mControlOffset; | 407 return mControlOffset; |
| 408 } | 408 } |
| 409 | 409 |
| 410 /** | 410 /** |
| 411 * @return The toolbar control container. | 411 * @return The toolbar control container. |
| 412 */ | 412 */ |
| 413 public ControlContainer getControlContainer() { | 413 public ControlContainer getControlContainer() { |
| 414 return mControlContainer; | 414 return mControlContainer; |
| 415 } | 415 } |
| 416 | 416 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 | 486 |
| 487 /** | 487 /** |
| 488 * Updates the content view's viewport size to have it render the content co
rrectly. | 488 * Updates the content view's viewport size to have it render the content co
rrectly. |
| 489 * | 489 * |
| 490 * @param viewCore The ContentViewCore to update. | 490 * @param viewCore The ContentViewCore to update. |
| 491 */ | 491 */ |
| 492 public void updateContentViewViewportSize(ContentViewCore viewCore) { | 492 public void updateContentViewViewportSize(ContentViewCore viewCore) { |
| 493 if (viewCore == null) return; | 493 if (viewCore == null) return; |
| 494 if (mInGesture || mContentViewScrolling) return; | 494 if (mInGesture || mContentViewScrolling) return; |
| 495 | 495 |
| 496 // Update content viewport size only when the top controls are not anima
ting. | 496 // Update content viewport size only when the browser controls are not a
nimating. |
| 497 int contentOffset = (int) rendererContentOffset(); | 497 int contentOffset = (int) rendererContentOffset(); |
| 498 if (contentOffset != 0 && contentOffset != mControlContainerHeight) retu
rn; | 498 if (contentOffset != 0 && contentOffset != mControlContainerHeight) retu
rn; |
| 499 viewCore.setTopControlsHeight(mControlContainerHeight, contentOffset > 0
); | 499 viewCore.setTopControlsHeight(mControlContainerHeight, contentOffset > 0
); |
| 500 } | 500 } |
| 501 | 501 |
| 502 @Override | 502 @Override |
| 503 public void updateContentViewChildrenState() { | 503 public void updateContentViewChildrenState() { |
| 504 ContentViewCore contentViewCore = getActiveContentViewCore(); | 504 ContentViewCore contentViewCore = getActiveContentViewCore(); |
| 505 if (contentViewCore == null) return; | 505 if (contentViewCore == null) return; |
| 506 ViewGroup view = contentViewCore.getContainerView(); | 506 ViewGroup view = contentViewCore.getContainerView(); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 528 float offset = getControlOffset(); | 528 float offset = getControlOffset(); |
| 529 if (Float.compare(mPreviousControlOffset, offset) != 0) { | 529 if (Float.compare(mPreviousControlOffset, offset) != 0) { |
| 530 mPreviousControlOffset = offset; | 530 mPreviousControlOffset = offset; |
| 531 | 531 |
| 532 scheduleVisibilityUpdate(); | 532 scheduleVisibilityUpdate(); |
| 533 if (shouldShowAndroidControls()) { | 533 if (shouldShowAndroidControls()) { |
| 534 mControlContainer.getView().setTranslationY(getControlOffset()); | 534 mControlContainer.getView().setTranslationY(getControlOffset()); |
| 535 } | 535 } |
| 536 | 536 |
| 537 // Whether we need the compositor to draw again to update our animat
ion. | 537 // Whether we need the compositor to draw again to update our animat
ion. |
| 538 // Should be |false| when the top controls are only moved through th
e page scrolling. | 538 // Should be |false| when the browser controls are only moved throug
h the page |
| 539 // scrolling. |
| 539 boolean needsAnimate = mControlAnimation != null || shouldShowAndroi
dControls(); | 540 boolean needsAnimate = mControlAnimation != null || shouldShowAndroi
dControls(); |
| 540 for (int i = 0; i < mListeners.size(); i++) { | 541 for (int i = 0; i < mListeners.size(); i++) { |
| 541 mListeners.get(i).onVisibleContentOffsetChanged( | 542 mListeners.get(i).onVisibleContentOffsetChanged( |
| 542 getVisibleContentOffset(), needsAnimate); | 543 getVisibleContentOffset(), needsAnimate); |
| 543 } | 544 } |
| 544 } | 545 } |
| 545 | 546 |
| 546 final Tab tab = getTab(); | 547 final Tab tab = getTab(); |
| 547 if (tab != null && offset == -mControlContainerHeight && mIsEnteringPers
istentModeState) { | 548 if (tab != null && offset == -mControlContainerHeight && mIsEnteringPers
istentModeState) { |
| 548 getHtmlApiHandler().enterFullscreen(tab); | 549 getHtmlApiHandler().enterFullscreen(tab); |
| 549 mIsEnteringPersistentModeState = false; | 550 mIsEnteringPersistentModeState = false; |
| 550 } | 551 } |
| 551 | 552 |
| 552 updateContentViewChildrenState(); | 553 updateContentViewChildrenState(); |
| 553 | 554 |
| 554 float contentOffset = getContentOffset(); | 555 float contentOffset = getContentOffset(); |
| 555 if (Float.compare(mPreviousContentOffset, contentOffset) != 0) { | 556 if (Float.compare(mPreviousContentOffset, contentOffset) != 0) { |
| 556 for (int i = 0; i < mListeners.size(); i++) { | 557 for (int i = 0; i < mListeners.size(); i++) { |
| 557 mListeners.get(i).onContentOffsetChanged(contentOffset); | 558 mListeners.get(i).onContentOffsetChanged(contentOffset); |
| 558 } | 559 } |
| 559 mPreviousContentOffset = contentOffset; | 560 mPreviousContentOffset = contentOffset; |
| 560 } | 561 } |
| 561 | 562 |
| 562 TraceEvent.end("FullscreenManager:updateVisuals"); | 563 TraceEvent.end("FullscreenManager:updateVisuals"); |
| 563 } | 564 } |
| 564 | 565 |
| 565 /** | 566 /** |
| 566 * @param hide Whether or not to force the top controls Android view to hide
. If this is | 567 * @param hide Whether or not to force the browser controls Android view to
hide. If this is |
| 567 * {@code false} the top controls Android view will show/hide ba
sed on position, if | 568 * {@code false} the browser controls Android view will show/hid
e based on position, |
| 568 * it is {@code true} the top controls Android view will always
be hidden. | 569 * if it is {@code true} the browser controls Android view will
always be hidden. |
| 569 */ | 570 */ |
| 570 public void setHideTopControlsAndroidView(boolean hide) { | 571 public void setHideBrowserControlsAndroidView(boolean hide) { |
| 571 if (mTopControlsAndroidViewHidden == hide) return; | 572 if (mBrowserControlsAndroidViewHidden == hide) return; |
| 572 mTopControlsAndroidViewHidden = hide; | 573 mBrowserControlsAndroidViewHidden = hide; |
| 573 scheduleVisibilityUpdate(); | 574 scheduleVisibilityUpdate(); |
| 574 } | 575 } |
| 575 | 576 |
| 576 private boolean shouldShowAndroidControls() { | 577 private boolean shouldShowAndroidControls() { |
| 577 if (mTopControlsAndroidViewHidden) return false; | 578 if (mBrowserControlsAndroidViewHidden) return false; |
| 578 | 579 |
| 579 boolean showControls = getControlOffset() == 0; | 580 boolean showControls = getControlOffset() == 0; |
| 580 ContentViewCore contentViewCore = getActiveContentViewCore(); | 581 ContentViewCore contentViewCore = getActiveContentViewCore(); |
| 581 if (contentViewCore == null) return showControls; | 582 if (contentViewCore == null) return showControls; |
| 582 ViewGroup contentView = contentViewCore.getContainerView(); | 583 ViewGroup contentView = contentViewCore.getContainerView(); |
| 583 | 584 |
| 584 for (int i = 0; i < contentView.getChildCount(); i++) { | 585 for (int i = 0; i < contentView.getChildCount(); i++) { |
| 585 View child = contentView.getChildAt(i); | 586 View child = contentView.getChildAt(i); |
| 586 if (!(child.getLayoutParams() instanceof FrameLayout.LayoutParams))
continue; | 587 if (!(child.getLayoutParams() instanceof FrameLayout.LayoutParams))
continue; |
| 587 | 588 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 629 } | 630 } |
| 630 | 631 |
| 631 private ContentViewCore getActiveContentViewCore() { | 632 private ContentViewCore getActiveContentViewCore() { |
| 632 Tab tab = getTab(); | 633 Tab tab = getTab(); |
| 633 return tab != null ? tab.getContentViewCore() : null; | 634 return tab != null ? tab.getContentViewCore() : null; |
| 634 } | 635 } |
| 635 | 636 |
| 636 @Override | 637 @Override |
| 637 public void setPositionsForTabToNonFullscreen() { | 638 public void setPositionsForTabToNonFullscreen() { |
| 638 Tab tab = getTab(); | 639 Tab tab = getTab(); |
| 639 if (tab == null || tab.isShowingTopControlsEnabled()) { | 640 if (tab == null || tab.isShowingBrowserControlsEnabled()) { |
| 640 setPositionsForTab(0, mControlContainerHeight); | 641 setPositionsForTab(0, mControlContainerHeight); |
| 641 } else { | 642 } else { |
| 642 setPositionsForTab(-mControlContainerHeight, 0); | 643 setPositionsForTab(-mControlContainerHeight, 0); |
| 643 } | 644 } |
| 644 } | 645 } |
| 645 | 646 |
| 646 @Override | 647 @Override |
| 647 public void setPositionsForTab(float controlsOffset, float contentOffset) { | 648 public void setPositionsForTab(float controlsOffset, float contentOffset) { |
| 648 // Once we get an update from a tab, clear the activity show token and a
llow the render | 649 // Once we get an update from a tab, clear the activity show token and a
llow the render |
| 649 // to control the positions of the top controls. | 650 // to control the positions of the browser controls. |
| 650 if (mActivityShowToken != INVALID_TOKEN) { | 651 if (mActivityShowToken != INVALID_TOKEN) { |
| 651 hideControlsPersistent(mActivityShowToken); | 652 hideControlsPersistent(mActivityShowToken); |
| 652 mActivityShowToken = INVALID_TOKEN; | 653 mActivityShowToken = INVALID_TOKEN; |
| 653 } | 654 } |
| 654 | 655 |
| 655 float rendererControlOffset = | 656 float rendererControlOffset = |
| 656 Math.round(Math.max(controlsOffset, -mControlContainerHeight)); | 657 Math.round(Math.max(controlsOffset, -mControlContainerHeight)); |
| 657 float rendererContentOffset = Math.min( | 658 float rendererContentOffset = Math.min( |
| 658 Math.round(contentOffset), rendererControlOffset + mControlConta
inerHeight); | 659 Math.round(contentOffset), rendererControlOffset + mControlConta
inerHeight); |
| 659 | 660 |
| 660 if (Float.compare(rendererControlOffset, mRendererControlOffset) == 0 | 661 if (Float.compare(rendererControlOffset, mRendererControlOffset) == 0 |
| 661 && Float.compare(rendererContentOffset, mRendererContentOffset)
== 0) { | 662 && Float.compare(rendererContentOffset, mRendererContentOffset)
== 0) { |
| 662 return; | 663 return; |
| 663 } | 664 } |
| 664 | 665 |
| 665 mRendererControlOffset = rendererControlOffset; | 666 mRendererControlOffset = rendererControlOffset; |
| 666 mRendererContentOffset = rendererContentOffset; | 667 mRendererContentOffset = rendererContentOffset; |
| 667 updateControlOffset(); | 668 updateControlOffset(); |
| 668 | 669 |
| 669 if (mControlAnimation == null) updateVisuals(); | 670 if (mControlAnimation == null) updateVisuals(); |
| 670 } | 671 } |
| 671 | 672 |
| 672 /** | 673 /** |
| 673 * @param e The dispatched motion event | 674 * @param e The dispatched motion event |
| 674 * @return Whether or not this motion event is in the top control container
area and should be | 675 * @return Whether or not this motion event is in the top control container
area and should be |
| 675 * consumed. | 676 * consumed. |
| 676 */ | 677 */ |
| 677 public boolean onInterceptMotionEvent(MotionEvent e) { | 678 public boolean onInterceptMotionEvent(MotionEvent e) { |
| 678 return e.getY() < getControlOffset() + mControlContainerHeight | 679 return e.getY() < getControlOffset() + mControlContainerHeight |
| 679 && !mTopControlsAndroidViewHidden; | 680 && !mBrowserControlsAndroidViewHidden; |
| 680 } | 681 } |
| 681 | 682 |
| 682 /** | 683 /** |
| 683 * Notifies the fullscreen manager that a motion event has occurred. | 684 * Notifies the fullscreen manager that a motion event has occurred. |
| 684 * @param e The dispatched motion event. | 685 * @param e The dispatched motion event. |
| 685 */ | 686 */ |
| 686 public void onMotionEvent(MotionEvent e) { | 687 public void onMotionEvent(MotionEvent e) { |
| 687 int eventAction = e.getActionMasked(); | 688 int eventAction = e.getActionMasked(); |
| 688 if (eventAction == MotionEvent.ACTION_DOWN | 689 if (eventAction == MotionEvent.ACTION_DOWN |
| 689 || eventAction == MotionEvent.ACTION_POINTER_DOWN) { | 690 || eventAction == MotionEvent.ACTION_POINTER_DOWN) { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 mControlAnimation.start(); | 762 mControlAnimation.start(); |
| 762 mCurrentAnimationIsShowing = show; | 763 mCurrentAnimationIsShowing = show; |
| 763 } | 764 } |
| 764 | 765 |
| 765 @Override | 766 @Override |
| 766 public void onContentViewScrollingStateChanged(boolean scrolling) { | 767 public void onContentViewScrollingStateChanged(boolean scrolling) { |
| 767 mContentViewScrolling = scrolling; | 768 mContentViewScrolling = scrolling; |
| 768 if (!scrolling) updateVisuals(); | 769 if (!scrolling) updateVisuals(); |
| 769 } | 770 } |
| 770 } | 771 } |
| OLD | NEW |