Bug 895173: Rename context menu id's to "home_" for home context menu. [r=margaret]

This commit is contained in:
Sriram Ramasubramanian 2013-07-22 14:46:59 -07:00
parent 2993b94f76
commit f752494d78
4 changed files with 25 additions and 25 deletions

View File

@ -218,8 +218,8 @@ public class BookmarksPage extends HomeFragment {
isPrivate = tab.isPrivate();
}
menu.findItem(R.id.open_new_tab).setVisible(!isPrivate);
menu.findItem(R.id.open_private_tab).setVisible(isPrivate);
menu.findItem(R.id.top_bookmarks_open_new_tab).setVisible(!isPrivate);
menu.findItem(R.id.top_bookmarks_open_private_tab).setVisible(isPrivate);
if (info.isPinned) {
menu.findItem(R.id.top_bookmarks_pin).setVisible(false);
@ -227,8 +227,8 @@ public class BookmarksPage extends HomeFragment {
menu.findItem(R.id.top_bookmarks_unpin).setVisible(false);
}
} else {
menu.findItem(R.id.open_new_tab).setVisible(false);
menu.findItem(R.id.open_private_tab).setVisible(false);
menu.findItem(R.id.top_bookmarks_open_new_tab).setVisible(false);
menu.findItem(R.id.top_bookmarks_open_private_tab).setVisible(false);
menu.findItem(R.id.top_bookmarks_pin).setVisible(false);
menu.findItem(R.id.top_bookmarks_unpin).setVisible(false);
}
@ -247,15 +247,15 @@ public class BookmarksPage extends HomeFragment {
final Activity activity = getActivity();
switch(item.getItemId()) {
case R.id.open_new_tab:
case R.id.open_private_tab: {
case R.id.top_bookmarks_open_new_tab:
case R.id.top_bookmarks_open_private_tab: {
if (info.url == null) {
Log.e(LOGTAG, "Can't open in new tab because URL is null");
break;
}
int flags = Tabs.LOADURL_NEW_TAB | Tabs.LOADURL_BACKGROUND;
if (item.getItemId() == R.id.open_private_tab)
if (item.getItemId() == R.id.top_bookmarks_open_private_tab)
flags |= Tabs.LOADURL_PRIVATE;
Tabs.getInstance().loadUrl(info.url, flags);

View File

@ -72,17 +72,17 @@ class HomeFragment extends Fragment {
if (tab != null) {
isPrivate = tab.isPrivate();
}
menu.findItem(R.id.open_new_tab).setVisible(!isPrivate);
menu.findItem(R.id.open_private_tab).setVisible(isPrivate);
menu.findItem(R.id.home_open_new_tab).setVisible(!isPrivate);
menu.findItem(R.id.home_open_private_tab).setVisible(isPrivate);
// Hide "Remove" item if there isn't a valid history ID
if (info.rowId < 0) {
menu.findItem(R.id.remove_history).setVisible(false);
menu.findItem(R.id.home_remove_history).setVisible(false);
}
menu.setHeaderTitle(info.title);
menu.findItem(R.id.remove_history).setVisible(false);
menu.findItem(R.id.open_in_reader).setVisible(false);
menu.findItem(R.id.home_remove_history).setVisible(false);
menu.findItem(R.id.home_open_in_reader).setVisible(false);
}
@Override
@ -128,15 +128,15 @@ class HomeFragment extends Fragment {
return true;
}
case R.id.open_private_tab:
case R.id.open_new_tab: {
case R.id.home_open_private_tab:
case R.id.home_open_new_tab: {
if (info.url == null) {
Log.e(LOGTAG, "Can't open in new tab because URL is null");
break;
}
int flags = Tabs.LOADURL_NEW_TAB | Tabs.LOADURL_BACKGROUND;
if (item.getItemId() == R.id.open_private_tab)
if (item.getItemId() == R.id.home_open_private_tab)
flags |= Tabs.LOADURL_PRIVATE;
Tabs.getInstance().loadUrl(info.url, flags);
@ -144,12 +144,12 @@ class HomeFragment extends Fragment {
return true;
}
case R.id.edit_bookmark: {
case R.id.home_edit_bookmark: {
new EditBookmarkDialog(activity).show(info.url);
return true;
}
case R.id.remove_bookmark: {
case R.id.home_remove_bookmark: {
final int rowId = info.rowId;
final String url = info.url;
final boolean inReadingList = info.inReadingList;

View File

@ -5,25 +5,25 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/open_new_tab"
<item android:id="@+id/home_open_new_tab"
android:title="@string/contextmenu_open_new_tab"/>
<item android:id="@+id/open_private_tab"
<item android:id="@+id/home_open_private_tab"
android:title="@string/contextmenu_open_private_tab"/>
<item android:id="@+id/open_in_reader"
<item android:id="@+id/home_open_in_reader"
android:title="@string/contextmenu_open_in_reader"/>
<item android:id="@+id/home_share"
android:title="@string/contextmenu_share"/>
<item android:id="@+id/edit_bookmark"
<item android:id="@+id/home_edit_bookmark"
android:title="@string/contextmenu_edit_bookmark"/>
<item android:id="@+id/remove_history"
<item android:id="@+id/home_remove_history"
android:title="@string/contextmenu_remove_history"/>
<item android:id="@+id/remove_bookmark"
<item android:id="@+id/home_remove_bookmark"
android:title="@string/contextmenu_remove_bookmark"/>
<item android:id="@+id/home_add_to_launcher"

View File

@ -5,10 +5,10 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/open_new_tab"
<item android:id="@+id/top_bookmarks_open_new_tab"
android:title="@string/contextmenu_open_new_tab"/>
<item android:id="@+id/open_private_tab"
<item android:id="@+id/top_bookmarks_open_private_tab"
android:title="@string/contextmenu_open_private_tab"/>
<item android:id="@+id/top_bookmarks_edit"