/** Update the progress, from 0 to 100. */ public void setProgress(int newProgress) { if (newProgress >= PROGRESS_MAX) { mProgress.setProgress(PageProgressView.MAX_PROGRESS); mProgress.setVisibility(View.GONE); mInLoad = false; mNavBar.onProgressStopped(); // check if needs to be hidden if (!isEditingUrl() && !wantsToBeVisible()) { hide(); if (mUseQuickControls) { setShowProgressOnly(false); } } } else { if (!mInLoad) { mProgress.setVisibility(View.VISIBLE); mInLoad = true; mNavBar.onProgressStarted(); } mProgress.setProgress(newProgress * PageProgressView.MAX_PROGRESS / PROGRESS_MAX); if (!mShowing) { if (mUseQuickControls && !isEditingUrl()) { setShowProgressOnly(true); } show(); } } }