diff options
| author | John Reck <jreck@google.com> | 2010-11-22 14:15:36 -0800 |
|---|---|---|
| committer | John Reck <jreck@google.com> | 2010-11-24 15:58:51 -0800 |
| commit | c8490818ccb693ed2610366d2e91fb290e40c372 (patch) | |
| tree | 5f48e40f032afd0384da01ae27ea1ad70065ed88 /src/com/android/browser/BookmarkUtils.java | |
| parent | a62b093ebf6ac8071eddf96edb6457ff55ebd1a3 (diff) | |
Adds context menu for folders (edit/delete)
Bug: 3214901
Adds support for folder context menus to edit and delete folders.
Change-Id: I89cb2fa4b139ba3f59ec62b34154d5837c7f471b
Diffstat (limited to 'src/com/android/browser/BookmarkUtils.java')
| -rw-r--r-- | src/com/android/browser/BookmarkUtils.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/com/android/browser/BookmarkUtils.java b/src/com/android/browser/BookmarkUtils.java index 751c0b3e..a63b90fb 100644 --- a/src/com/android/browser/BookmarkUtils.java +++ b/src/com/android/browser/BookmarkUtils.java @@ -18,6 +18,7 @@ package com.android.browser; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; @@ -29,8 +30,10 @@ import android.graphics.PorterDuffXfermode; import android.graphics.Rect; import android.graphics.RectF; import android.net.Uri; +import android.preference.PreferenceManager; import android.provider.Browser; -import android.util.Log; +import android.provider.BrowserContract; +import android.text.TextUtils; class BookmarkUtils { private final static String LOGTAG = "BookmarkUtils"; @@ -165,4 +168,17 @@ class BookmarkUtils { canvas.drawBitmap(favicon, null, r, p); } + /* package */ static Uri getBookmarksUri(Context context) { + Uri uri = BrowserContract.Bookmarks.CONTENT_URI; + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + String accountType = prefs.getString(BrowserBookmarksPage.PREF_ACCOUNT_TYPE, null); + String accountName = prefs.getString(BrowserBookmarksPage.PREF_ACCOUNT_NAME, null); + if (!TextUtils.isEmpty(accountName) && !TextUtils.isEmpty(accountType)) { + uri = uri.buildUpon() + .appendQueryParameter(BrowserContract.Bookmarks.PARAM_ACCOUNT_NAME, accountName) + .appendQueryParameter(BrowserContract.Bookmarks.PARAM_ACCOUNT_TYPE, accountType) + .build(); + } + return uri; + } }; |
