diff options
author | Sagar Dhawan <sdhawan@codeaurora.org> | 2015-09-07 15:23:22 +0200 |
---|---|---|
committer | jrizzoli <joey@cyanogenmoditalia.it> | 2015-11-05 14:22:56 +0100 |
commit | ef06f56b0c3b325ead98bee17da44a66bc25ab9e (patch) | |
tree | 731ee0f57faa1c98176c467892f5533a7a256fbc /src/com/android/browser/Controller.java | |
parent | 6091a54f957165a5601dd7e2521b1f9765c28dc5 (diff) | |
download | android_packages_apps_Gello-ef06f56b0c3b325ead98bee17da44a66bc25ab9e.tar.gz android_packages_apps_Gello-ef06f56b0c3b325ead98bee17da44a66bc25ab9e.tar.bz2 android_packages_apps_Gello-ef06f56b0c3b325ead98bee17da44a66bc25ab9e.zip |
Fix problems with bookmarks
- Fixed incorrect detection of non-bookmarked pages showing
as bookmarked.
- Changed bookmarks to allow any scheme the engine can support
- Changed bookmarks to only look for page url not title
when looking up or adding bookmarks
- Bookmarks will now use new apis to "fix" urls. These are the
same api's the engine uses. This ensures that the bookmarks
db treats urls exactly like the rest of the browser
- Fixed crashes when launching bookmarks via an intent
with wrong parameters
Change-Id: I18d1f5b55c65e6fecf731128cef6d02222fd68a9
Diffstat (limited to 'src/com/android/browser/Controller.java')
-rw-r--r-- | src/com/android/browser/Controller.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index cbc6ba05..fa77d415 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -1939,16 +1939,16 @@ public class Controller } } - private int lookupBookmark(String title, String url) { + private int lookupBookmark( String url) { final ContentResolver cr = getActivity().getContentResolver(); int count = 0; Cursor cursor = null; try { cursor = cr.query(BrowserContract.Bookmarks.CONTENT_URI, BookmarksLoader.PROJECTION, - "title = ? OR url = ?", + "url = ?", new String[] { - title, url + url }, null); @@ -1973,7 +1973,7 @@ public class Controller String title = w.getTitle(); String url = w.getUrl(); - mCurrentPageBookmarked = (lookupBookmark(title, url) > 0); + mCurrentPageBookmarked = (lookupBookmark(url) > 0); if (title != null && url != null && mCurrentPageBookmarked) { bookmark_icon.setChecked(true); } else { @@ -2032,12 +2032,12 @@ public class Controller boolean showDebugSettings = mSettings.isDebugEnabled(); final MenuItem uaSwitcher = menu.findItem(R.id.ua_desktop_menu_id); uaSwitcher.setChecked(isDesktopUa); - menu.setGroupVisible(R.id.LIVE_MENU, isLive && isLiveScheme); - menu.setGroupVisible(R.id.NAV_MENU, isLive && isLiveScheme); + setMenuItemVisibility(menu, R.id.find_menu_id, isLive); + menu.setGroupVisible(R.id.NAV_MENU, isLive); setMenuItemVisibility(menu, R.id.find_menu_id, isLive && isLiveScheme); menu.setGroupVisible(R.id.SNAPSHOT_MENU, !isLive); setMenuItemVisibility(menu, R.id.add_to_homescreen, - isLive && isLiveScheme && isPageFinished); + isLive && isPageFinished); setMenuItemVisibility(menu, R.id.save_snapshot_menu_id, isLive && ( isLiveScheme || isDistilled ) && isPageFinished && isSavable); // history and snapshots item are the members of COMBO menu group, |