summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2012-04-25 14:14:26 -0700
committerMichael Kolb <kolby@google.com>2012-04-25 14:14:26 -0700
commite8a823329e004c4261ee5f810e1ca3ebd90914dd (patch)
treeaff80fe421ec67f92ee8c2feb940e037cb528c71 /src/com/android
parent799a1ac48f47606404608d06f5aa17d0d3118a1b (diff)
downloadpackages_apps_Browser-e8a823329e004c4261ee5f810e1ca3ebd90914dd.zip
packages_apps_Browser-e8a823329e004c4261ee5f810e1ca3ebd90914dd.tar.gz
packages_apps_Browser-e8a823329e004c4261ee5f810e1ca3ebd90914dd.tar.bz2
Fix QuickControls after title bar tweaks
Bug: 6398599 Minor cleanup in title bar code. Change-Id: I55357acb86050e549d80d44d99f4a89ed1e49e9d
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/browser/BaseUi.java9
-rw-r--r--src/com/android/browser/PhoneUi.java6
-rw-r--r--src/com/android/browser/Tab.java6
-rw-r--r--src/com/android/browser/TitleBar.java8
-rw-r--r--src/com/android/browser/XLargeUi.java15
5 files changed, 15 insertions, 29 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java
index 7b7e25f..01c7da6 100644
--- a/src/com/android/browser/BaseUi.java
+++ b/src/com/android/browser/BaseUi.java
@@ -224,6 +224,14 @@ public abstract class BaseUi implements UI {
}
@Override
+ public void onProgressChanged(Tab tab) {
+ int progress = tab.getLoadProgress();
+ if (tab.inForeground()) {
+ mTitleBar.setProgress(progress);
+ }
+ }
+
+ @Override
public void bookmarkedStatusHasChanged(Tab tab) {
if (tab.inForeground()) {
boolean isBookmark = tab.isBookmarkedSite();
@@ -270,6 +278,7 @@ public abstract class BaseUi implements UI {
if (mUseQuickControls) {
mPieControl.forceToTop(mContentView);
web.setTitleBar(null);
+ mTitleBar.hide();
} else {
web.setTitleBar(mTitleBar);
mTitleBar.onScrollChanged();
diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java
index b269586..ed63daa 100644
--- a/src/com/android/browser/PhoneUi.java
+++ b/src/com/android/browser/PhoneUi.java
@@ -103,10 +103,7 @@ public class PhoneUi extends BaseUi {
@Override
public void onProgressChanged(Tab tab) {
- if (tab.inForeground()) {
- int progress = tab.getLoadProgress();
- mTitleBar.setProgress(progress);
- }
+ super.onProgressChanged(tab);
if (mNavScreen == null && getTitleBar().getHeight() > 0) {
mHandler.sendEmptyMessage(MSG_INIT_NAVSCREEN);
}
@@ -145,6 +142,7 @@ public class PhoneUi extends BaseUi {
if (mUseQuickControls) {
mPieControl.forceToTop(mContentView);
view.setTitleBar(null);
+ mTitleBar.setShowProgressOnly(true);
} else {
view.setTitleBar(mTitleBar);
}
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index cbda456..73f5b9e 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -1958,12 +1958,6 @@ class Tab implements PictureListener {
return mInPageLoad;
}
- // force mInLoad to be false. This should only be called before closing the
- // tab to ensure BrowserActivity's pauseWebViewTimers() is called correctly.
- void clearInPageLoad() {
- mInPageLoad = false;
- }
-
/**
* @return The Bundle with the tab's state if it can be saved, otherwise null
*/
diff --git a/src/com/android/browser/TitleBar.java b/src/com/android/browser/TitleBar.java
index f7ca0d4..9ec972b 100644
--- a/src/com/android/browser/TitleBar.java
+++ b/src/com/android/browser/TitleBar.java
@@ -228,7 +228,7 @@ public class TitleBar extends RelativeLayout {
// check if needs to be hidden
if (!isEditingUrl() && !wantsToBeVisible()) {
if (mUseQuickControls) {
- setShowProgressOnly(false);
+ hide();
} else {
mBaseUi.showTitleBarForDuration();
}
@@ -241,10 +241,10 @@ public class TitleBar extends RelativeLayout {
}
mProgress.setProgress(newProgress * PageProgressView.MAX_PROGRESS
/ PROGRESS_MAX);
+ if (mUseQuickControls && !isEditingUrl()) {
+ setShowProgressOnly(true);
+ }
if (!mShowing) {
- if (mUseQuickControls && !isEditingUrl()) {
- setShowProgressOnly(true);
- }
show();
}
}
diff --git a/src/com/android/browser/XLargeUi.java b/src/com/android/browser/XLargeUi.java
index 1969978..d7f1559 100644
--- a/src/com/android/browser/XLargeUi.java
+++ b/src/com/android/browser/XLargeUi.java
@@ -135,21 +135,6 @@ public class XLargeUi extends BaseUi {
// WebView callbacks
@Override
- public void onProgressChanged(Tab tab) {
- int progress = tab.getLoadProgress();
- if (tab.inForeground()) {
- mTitleBar.setProgress(progress);
- if (mUseQuickControls) {
- if (progress == 100) {
- mTitleBar.setShowProgressOnly(false);
- } else if (!mTitleBar.isEditingUrl()) {
- mTitleBar.setShowProgressOnly(true);
- }
- }
- }
- }
-
- @Override
public void addTab(Tab tab) {
mTabBar.onNewTab(tab);
}