| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.compositor.bottombar; | 5 package org.chromium.chrome.browser.compositor.bottombar; |
| 6 | 6 |
| 7 import android.text.TextUtils; | 7 import android.text.TextUtils; |
| 8 | 8 |
| 9 import org.chromium.base.VisibleForTesting; | 9 import org.chromium.base.VisibleForTesting; |
| 10 import org.chromium.base.annotations.CalledByNative; | 10 import org.chromium.base.annotations.CalledByNative; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 OverlayContentProgressObserver progressObserver, ChromeActivity acti
vity) { | 125 OverlayContentProgressObserver progressObserver, ChromeActivity acti
vity) { |
| 126 mNativeOverlayPanelContentPtr = nativeInit(); | 126 mNativeOverlayPanelContentPtr = nativeInit(); |
| 127 mContentDelegate = contentDelegate; | 127 mContentDelegate = contentDelegate; |
| 128 mProgressObserver = progressObserver; | 128 mProgressObserver = progressObserver; |
| 129 mActivity = activity; | 129 mActivity = activity; |
| 130 | 130 |
| 131 mWebContentsDelegate = new WebContentsDelegateAndroid() { | 131 mWebContentsDelegate = new WebContentsDelegateAndroid() { |
| 132 private boolean mIsFullscreen; | 132 private boolean mIsFullscreen; |
| 133 | 133 |
| 134 @Override | 134 @Override |
| 135 public void onLoadStarted(boolean toDifferentDocument) { | 135 public void loadingStateChanged(boolean toDifferentDocument) { |
| 136 super.onLoadStarted(toDifferentDocument); | 136 boolean isLoading = mContentViewCore != null |
| 137 mProgressObserver.onProgressBarStarted(); | 137 && mContentViewCore.getWebContents() != null |
| 138 } | 138 && mContentViewCore.getWebContents().isLoading(); |
| 139 | 139 if (isLoading) { |
| 140 @Override | 140 mProgressObserver.onProgressBarStarted(); |
| 141 public void onLoadStopped() { | 141 } else { |
| 142 super.onLoadStopped(); | 142 mProgressObserver.onProgressBarFinished(); |
| 143 mProgressObserver.onProgressBarFinished(); | 143 } |
| 144 } | 144 } |
| 145 | 145 |
| 146 @Override | 146 @Override |
| 147 public void onLoadProgressChanged(int progress) { | 147 public void onLoadProgressChanged(int progress) { |
| 148 super.onLoadProgressChanged(progress); | |
| 149 mProgressObserver.onProgressBarUpdated(progress); | 148 mProgressObserver.onProgressBarUpdated(progress); |
| 150 } | 149 } |
| 151 | 150 |
| 152 @Override | 151 @Override |
| 153 public void toggleFullscreenModeForTab(boolean enterFullscreen) { | 152 public void toggleFullscreenModeForTab(boolean enterFullscreen) { |
| 154 mIsFullscreen = enterFullscreen; | 153 mIsFullscreen = enterFullscreen; |
| 155 } | 154 } |
| 156 | 155 |
| 157 @Override | 156 @Override |
| 158 public boolean isFullscreenForTabOrPending() { | 157 public boolean isFullscreenForTabOrPending() { |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 private native long nativeInit(); | 455 private native long nativeInit(); |
| 457 private native void nativeDestroy(long nativeOverlayPanelContent); | 456 private native void nativeDestroy(long nativeOverlayPanelContent); |
| 458 private native void nativeRemoveLastHistoryEntry( | 457 private native void nativeRemoveLastHistoryEntry( |
| 459 long nativeOverlayPanelContent, String historyUrl, long urlTimeMs); | 458 long nativeOverlayPanelContent, String historyUrl, long urlTimeMs); |
| 460 private native void nativeSetWebContents(long nativeOverlayPanelContent, | 459 private native void nativeSetWebContents(long nativeOverlayPanelContent, |
| 461 WebContents webContents, WebContentsDelegateAndroid delegate); | 460 WebContents webContents, WebContentsDelegateAndroid delegate); |
| 462 private native void nativeDestroyWebContents(long nativeOverlayPanelContent)
; | 461 private native void nativeDestroyWebContents(long nativeOverlayPanelContent)
; |
| 463 private native void nativeSetInterceptNavigationDelegate(long nativeOverlayP
anelContent, | 462 private native void nativeSetInterceptNavigationDelegate(long nativeOverlayP
anelContent, |
| 464 InterceptNavigationDelegate delegate, WebContents webContents); | 463 InterceptNavigationDelegate delegate, WebContents webContents); |
| 465 } | 464 } |
| OLD | NEW |