diff options
author | George Mount <mount@google.com> | 2011-10-07 15:57:53 -0700 |
---|---|---|
committer | George Mount <mount@google.com> | 2011-10-10 13:11:56 -0700 |
commit | 387d45d2284c7fd7f12cbadc96161f946ae29cad (patch) | |
tree | 04bc0d8cdcca96dc2d5730f26309885f55d99d95 /src/com/android/browser/NavigationBarTablet.java | |
parent | 07af26d9ae4239bad876e8fd7ac69984a1d66996 (diff) | |
download | android_packages_apps_Gello-387d45d2284c7fd7f12cbadc96161f946ae29cad.tar.gz android_packages_apps_Gello-387d45d2284c7fd7f12cbadc96161f946ae29cad.tar.bz2 android_packages_apps_Gello-387d45d2284c7fd7f12cbadc96161f946ae29cad.zip |
Data URL fixes - bookmarks, save, and wallpaper
Bug 5383517
Images kept in data URLs can now be selected and this fixes the
Save and Set Wallpaper options. It also removes the bookmarking
capability.
Change-Id: I461bdcb4c950f6fcd8db8b38f4c599212106b027
Diffstat (limited to 'src/com/android/browser/NavigationBarTablet.java')
-rw-r--r-- | src/com/android/browser/NavigationBarTablet.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/com/android/browser/NavigationBarTablet.java b/src/com/android/browser/NavigationBarTablet.java index c22b1a0c..be3a9aba 100644 --- a/src/com/android/browser/NavigationBarTablet.java +++ b/src/com/android/browser/NavigationBarTablet.java @@ -151,6 +151,12 @@ public class NavigationBarTablet extends NavigationBarBase { } @Override + public void onTabDataChanged(Tab tab) { + super.onTabDataChanged(tab); + showHideStar(tab); + } + + @Override public void setCurrentUrlIsBookmark(boolean isBookmark) { mStar.setActivated(isBookmark); } @@ -235,7 +241,7 @@ public class NavigationBarTablet extends NavigationBarBase { } mGoButton.setVisibility(View.GONE); mVoiceSearch.setVisibility(View.GONE); - mStar.setVisibility(View.VISIBLE); + showHideStar(mUiController.getCurrentTab()); mClearButton.setVisibility(View.GONE); if (mTitleBar.useQuickControls()) { mSearchButton.setVisibility(View.GONE); @@ -321,4 +327,16 @@ public class NavigationBarTablet extends NavigationBarBase { combo.start(); } + private void showHideStar(Tab tab) { + // hide the bookmark star for data URLs + if (tab != null && tab.inForeground()) { + int starVisibility = View.VISIBLE; + String url = tab.getUrl(); + if (DataUri.isDataUri(url)) { + starVisibility = View.GONE; + } + mStar.setVisibility(starVisibility); + } + } + } |