summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2010-12-10 12:02:16 -0800
committerJohn Reck <jreck@google.com>2010-12-10 12:02:16 -0800
commit1cebb445779da9ca597621c79b020d6e5ea54fb2 (patch)
treeb29cce896a997bfbd7eb7a0dabcbd64cf7e11a69 /src/com
parent3fa3269f75ee01c3a881ec56409d5f30bf279fcf (diff)
downloadpackages_apps_Browser-1cebb445779da9ca597621c79b020d6e5ea54fb2.zip
packages_apps_Browser-1cebb445779da9ca597621c79b020d6e5ea54fb2.tar.gz
packages_apps_Browser-1cebb445779da9ca597621c79b020d6e5ea54fb2.tar.bz2
Removed 'Other Bookmarks' context menu
Bug: 3253941 Change-Id: Ib2a4047a24632e3f56ff65afb1334203b292e9a4
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/browser/BookmarksLoader.java3
-rw-r--r--src/com/android/browser/BrowserBookmarksPage.java9
2 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/browser/BookmarksLoader.java b/src/com/android/browser/BookmarksLoader.java
index c5ca073..650c3ca 100644
--- a/src/com/android/browser/BookmarksLoader.java
+++ b/src/com/android/browser/BookmarksLoader.java
@@ -20,6 +20,7 @@ import android.content.Context;
import android.content.CursorLoader;
import android.net.Uri;
import android.provider.BrowserContract.Bookmarks;
+import android.provider.BrowserContract.ChromeSyncColumns;
import android.text.TextUtils;
public class BookmarksLoader extends CursorLoader {
@@ -34,6 +35,7 @@ public class BookmarksLoader extends CursorLoader {
public static final int COLUMN_INDEX_TOUCH_ICON = 5;
public static final int COLUMN_INDEX_IS_FOLDER = 6;
public static final int COLUMN_INDEX_PARENT = 8;
+ public static final int COLUMN_INDEX_SERVER_UNIQUE = 9;
public static final String[] PROJECTION = new String[] {
Bookmarks._ID, // 0
@@ -45,6 +47,7 @@ public class BookmarksLoader extends CursorLoader {
Bookmarks.IS_FOLDER, // 6
Bookmarks.POSITION, // 7
Bookmarks.PARENT, // 8
+ ChromeSyncColumns.SERVER_UNIQUE, // 9
};
private String mAccountType;
diff --git a/src/com/android/browser/BrowserBookmarksPage.java b/src/com/android/browser/BrowserBookmarksPage.java
index ccacee8..c030915 100644
--- a/src/com/android/browser/BrowserBookmarksPage.java
+++ b/src/com/android/browser/BrowserBookmarksPage.java
@@ -42,6 +42,7 @@ import android.os.Bundle;
import android.preference.PreferenceManager;
import android.provider.BrowserContract;
import android.provider.BrowserContract.Accounts;
+import android.provider.BrowserContract.ChromeSyncColumns;
import android.text.TextUtils;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
@@ -331,6 +332,9 @@ public class BrowserBookmarksPage extends Fragment implements View.OnCreateConte
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
Cursor cursor = mAdapter.getItem(info.position);
+ if (!canEdit(cursor)) {
+ return;
+ }
boolean isFolder
= cursor.getInt(BookmarksLoader.COLUMN_INDEX_IS_FOLDER) != 0;
@@ -355,6 +359,11 @@ public class BrowserBookmarksPage extends Fragment implements View.OnCreateConte
}
}
+ boolean canEdit(Cursor c) {
+ String unique = c.getString(BookmarksLoader.COLUMN_INDEX_SERVER_UNIQUE);
+ return !ChromeSyncColumns.FOLDER_NAME_OTHER_BOOKMARKS.equals(unique);
+ }
+
private void populateBookmarkItem(Cursor cursor, BookmarkItem item, boolean isFolder) {
item.setName(cursor.getString(BookmarksLoader.COLUMN_INDEX_TITLE));
if (isFolder) {