Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java

Issue 1381003004: Better distinguish didFinishLoad and didStopLoading (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix android failure Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.tab; 5 package org.chromium.chrome.browser.tab;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.Intent; 9 import android.content.Intent;
10 import android.content.res.Resources; 10 import android.content.res.Resources;
(...skipping 1361 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 for (TabObserver observer : mObservers) { 1372 for (TabObserver observer : mObservers) {
1373 observer.onOverlayContentViewCoreRemoved(this, content); 1373 observer.onOverlayContentViewCoreRemoved(this, content);
1374 } 1374 }
1375 1375
1376 assert mOverlayContentViewCores.contains(content); 1376 assert mOverlayContentViewCores.contains(content);
1377 mOverlayContentViewCores.remove(content); 1377 mOverlayContentViewCores.remove(content);
1378 1378
1379 nativeDetachOverlayContentViewCore(mNativeTabAndroid, content); 1379 nativeDetachOverlayContentViewCore(mNativeTabAndroid, content);
1380 } 1380 }
1381 1381
1382 protected void onLoadStarted() {
Ted C 2015/10/27 23:07:19 javadoc non-private methods
Nate Chapin 2015/10/28 20:57:39 Done.
1383 mIsLoading = true;
1384 for (TabObserver observer : mObservers) observer.onLoadStarted(this);
1385 }
1386
1387 protected void onLoadStopped() {
1388 mIsLoading = false;
1389 for (TabObserver observer : mObservers) observer.onLoadStopped(this);
1390 }
1391
1382 /** 1392 /**
1383 * Called when a page has started loading. 1393 * Called when a page has started loading.
1384 * @param validatedUrl URL being loaded. 1394 * @param validatedUrl URL being loaded.
1385 * @param showingErrorPage Whether an error page is being shown. 1395 * @param showingErrorPage Whether an error page is being shown.
1386 */ 1396 */
1387 protected void didStartPageLoad(String validatedUrl, boolean showingErrorPag e) { 1397 protected void didStartPageLoad(String validatedUrl, boolean showingErrorPag e) {
1388 mIsFullscreenWaitingForLoad = !DomDistillerUrlUtils.isDistilledPage(vali datedUrl); 1398 mIsFullscreenWaitingForLoad = !DomDistillerUrlUtils.isDistilledPage(vali datedUrl);
1389 1399
1390 mIsShowingErrorPage = showingErrorPage; 1400 mIsShowingErrorPage = showingErrorPage;
1391 mIsLoading = true;
1392 1401
1393 updateTitle(); 1402 updateTitle();
1394 removeSadTabIfPresent(); 1403 removeSadTabIfPresent();
1395 1404
1396 clearHungRendererState(); 1405 clearHungRendererState();
1397 1406
1398 for (TabObserver observer : mObservers) observer.onPageLoadStarted(this, validatedUrl); 1407 for (TabObserver observer : mObservers) observer.onPageLoadStarted(this, validatedUrl);
1399 } 1408 }
1400 1409
1401 /** 1410 /**
1402 * Called when a page has finished loading. 1411 * Called when a page has finished loading.
1403 */ 1412 */
1404 protected void didFinishPageLoad() { 1413 protected void didFinishPageLoad() {
1405 mIsLoading = false;
1406 mIsBeingRestored = false; 1414 mIsBeingRestored = false;
1407 mIsTabStateDirty = true; 1415 mIsTabStateDirty = true;
1408 updateTitle(); 1416 updateTitle();
1409 updateFullscreenEnabledState(); 1417 updateFullscreenEnabledState();
1410 if (!isNativePage()) { 1418 if (!isNativePage()) {
1411 RecordHistogram.recordBooleanHistogram( 1419 RecordHistogram.recordBooleanHistogram(
1412 "Navigation.IsMobileOptimized", mContentViewCore.getIsMobile OptimizedHint()); 1420 "Navigation.IsMobileOptimized", mContentViewCore.getIsMobile OptimizedHint());
1413 } 1421 }
1414 1422
1415 if (mTabUma != null) mTabUma.onLoadFinished(); 1423 if (mTabUma != null) mTabUma.onLoadFinished();
(...skipping 12 matching lines...) Expand all
1428 MSG_ID_ENABLE_FULLSCREEN_AFTER_LOAD, MAX_FULLSCREEN_LOAD_DEL AY_MS); 1436 MSG_ID_ENABLE_FULLSCREEN_AFTER_LOAD, MAX_FULLSCREEN_LOAD_DEL AY_MS);
1429 } 1437 }
1430 } 1438 }
1431 1439
1432 /** 1440 /**
1433 * Called when a page has failed loading. 1441 * Called when a page has failed loading.
1434 * @param errorCode The error code causing the page to fail loading. 1442 * @param errorCode The error code causing the page to fail loading.
1435 */ 1443 */
1436 protected void didFailPageLoad(int errorCode) { 1444 protected void didFailPageLoad(int errorCode) {
1437 cancelEnableFullscreenLoadDelay(); 1445 cancelEnableFullscreenLoadDelay();
1438 mIsLoading = false;
1439 mIsBeingRestored = false; 1446 mIsBeingRestored = false;
1440 if (mTabUma != null) mTabUma.onLoadFailed(errorCode); 1447 if (mTabUma != null) mTabUma.onLoadFailed(errorCode);
1441 for (TabObserver observer : mObservers) observer.onPageLoadFailed(this, errorCode); 1448 for (TabObserver observer : mObservers) observer.onPageLoadFailed(this, errorCode);
1442 updateFullscreenEnabledState(); 1449 updateFullscreenEnabledState();
1443 } 1450 }
1444 1451
1445 private void cancelEnableFullscreenLoadDelay() { 1452 private void cancelEnableFullscreenLoadDelay() {
1446 mHandler.removeMessages(MSG_ID_ENABLE_FULLSCREEN_AFTER_LOAD); 1453 mHandler.removeMessages(MSG_ID_ENABLE_FULLSCREEN_AFTER_LOAD);
1447 mIsFullscreenWaitingForLoad = false; 1454 mIsFullscreenWaitingForLoad = false;
1448 } 1455 }
(...skipping 1413 matching lines...) Expand 10 before | Expand all | Expand 10 after
2862 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro id, 2869 private native void nativeSetInterceptNavigationDelegate(long nativeTabAndro id,
2863 InterceptNavigationDelegate delegate); 2870 InterceptNavigationDelegate delegate);
2864 private native void nativeAttachToTabContentManager(long nativeTabAndroid, 2871 private native void nativeAttachToTabContentManager(long nativeTabAndroid,
2865 TabContentManager tabContentManager); 2872 TabContentManager tabContentManager);
2866 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid , 2873 private native void nativeAttachOverlayContentViewCore(long nativeTabAndroid ,
2867 ContentViewCore content, boolean visible); 2874 ContentViewCore content, boolean visible);
2868 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid , 2875 private native void nativeDetachOverlayContentViewCore(long nativeTabAndroid ,
2869 ContentViewCore content); 2876 ContentViewCore content);
2870 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url); 2877 private native boolean nativeHasPrerenderedUrl(long nativeTabAndroid, String url);
2871 } 2878 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698