/** 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()) { if (mUseQuickControls) { hide(); } else { mBaseUi.showTitleBarForDuration(); } } } else { if (!mInLoad) { mProgress.setVisibility(View.VISIBLE); mInLoad = true; mNavBar.onProgressStarted(); } mProgress.setProgress(newProgress * PageProgressView.MAX_PROGRESS / PROGRESS_MAX); if (mUseQuickControls && !isEditingUrl()) { // ActionsCode(hexibin, bugfix BUG00297099) // setShowProgressOnly(true); } if (!mShowing) { show(); } } }
void setShowProgressOnly(boolean progress) { if (progress && !wantsToBeVisible()) { mNavBar.setVisibility(View.GONE); } else { mNavBar.setVisibility(View.VISIBLE); } }
private int calculateEmbeddedHeight() { int height = mNavBar.getHeight(); if (mAutoLogin != null && mAutoLogin.getVisibility() == View.VISIBLE) { height += mAutoLogin.getHeight(); } return height; }
@Override public void setActiveTab(final Tab tab) { mHandler.removeMessages(MSG_HIDE_TITLEBAR); if ((tab != mActiveTab) && (mActiveTab != null)) { removeTabFromContentView(mActiveTab); WebView web = mActiveTab.getWebView(); if (web != null) { web.setOnTouchListener(null); } } mActiveTab = tab; WebView web = mActiveTab.getWebView(); updateUrlBarAutoShowManagerTarget(); attachTabToContentView(tab); setShouldShowErrorConsole(tab, mUiController.shouldShowErrorConsole()); onTabDataChanged(tab); onProgressChanged(tab); mNavigationBar.setIncognitoMode(tab.isPrivateBrowsingEnabled()); updateAutoLogin(tab, false); if (web != null && web.getVisibleTitleHeight() != mTitleBar.getEmbeddedHeight() && !mUseQuickControls) { showTitleBarForDuration(); } }
@Override public void bookmarkedStatusHasChanged(Tab tab) { if (tab.inForeground()) { boolean isBookmark = tab.isBookmarkedSite(); mNavigationBar.setCurrentUrlIsBookmark(isBookmark); } }
private void initLayout(Context context) { LayoutInflater factory = LayoutInflater.from(context); factory.inflate(R.layout.title_bar, this); mProgress = (PageProgressView) findViewById(R.id.progress); mNavBar = (NavigationBarBase) findViewById(R.id.taburlbar); mNavBar.setTitleBar(this); }
/** * Suggest to the UI that the title bar can be hidden. The UI will then decide whether or not to * hide based off a number of factors, such as if the user is editing the URL bar or if the page * is loading */ public void suggestHideTitleBar() { if (!isLoading() && !isEditingUrl() && !mTitleBar.wantsToBeVisible() && !mNavigationBar.isMenuShowing()) { hideTitleBar(); } }
public void editUrl(boolean clearInput) { if (mUiController.isInCustomActionMode()) { mUiController.endActionMode(); } showTitleBar(); if ((getActiveTab() != null) && !getActiveTab().isSnapshot()) { mNavigationBar.startEditingUrl(clearInput); } }
// Tab callbacks @Override public void onTabDataChanged(Tab tab) { setUrlTitle(tab); setFavicon(tab); updateLockIconToLatest(tab); updateNavigationState(tab); mTitleBar.onTabDataChanged(tab); mNavigationBar.onTabDataChanged(tab); onProgressChanged(tab); }
protected void setUrlTitle(Tab tab) { String url = tab.getUrl(); String title = tab.getTitle(); if (TextUtils.isEmpty(title)) { title = url; } if (tab.isInVoiceSearchMode()) return; if (tab.inForeground()) { mNavigationBar.setDisplayTitle(url); } }
/** Updates the lock-icon image in the title-bar. */ private void updateLockIconImage(SecurityState securityState) { Drawable d = null; if (securityState == SecurityState.SECURITY_STATE_SECURE) { d = mLockIconSecure; } else if (securityState == SecurityState.SECURITY_STATE_MIXED || securityState == SecurityState.SECURITY_STATE_BAD_CERTIFICATE) { // TODO: It would be good to have different icons for insecure vs mixed content. // See http://b/5403800 d = mLockIconMixed; } mNavigationBar.setLock(d); }
/** * *********************************** * * <p>ActionsCode(author:hexibin, change_code) */ void hide() { if (mUseQuickControls) { // ActionsCode(hexibin, bugfix BUG00297099) // this.setVisibility(View.GONE); setTranslationY(-mNavBar.getHeight()); } else { if (mIsFixedTitleBar) return; if (!mSkipTitleBarAnimations) { cancelTitleBarAnimation(false); int visibleHeight = getVisibleTitleHeight(); mTitleBarAnimator = ObjectAnimator.ofFloat( this, "translationY", getTranslationY(), (-getEmbeddedHeight() + visibleHeight)); mTitleBarAnimator.addListener(mHideTileBarAnimatorListener); setupTitleBarAnimator(mTitleBarAnimator); mTitleBarAnimator.start(); } else { onScrollChanged(); } } mShowing = false; }
// Set the favicon in the title bar. protected void setFavicon(Tab tab) { if (tab.inForeground()) { Bitmap icon = tab.getFavicon(); mNavigationBar.setFavicon(icon); } }
public void onTabDataChanged(Tab tab) { mNavBar.setVisibility(VISIBLE); }
public boolean isEditingUrl() { return mNavBar.isEditingUrl(); }
@Override public void showVoiceTitleBar(String title, List<String> results) { mNavigationBar.setInVoiceMode(true, results); mNavigationBar.setDisplayTitle(title); }
@Override public void revertVoiceTitleBar(Tab tab) { mNavigationBar.setInVoiceMode(false, null); String url = tab.getUrl(); mNavigationBar.setDisplayTitle(url); }
@Override public void registerDropdownChangeListener(DropdownChangeListener d) { mNavigationBar.registerDropdownChangeListener(d); }