From eac25cd7ae17cd626fe55060dcd0a003e6171ad7 Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 11 Aug 2011 16:03:32 -0700 Subject: Menu shuffling Bug: 5145209 Move some stuff from the overflow menu to the favicon menu Change-Id: Ied61630281f1fbb8078997d72af6333a6d527249 --- res/menu/browser.xml | 27 +++++++++----------------- res/menu/ua_switcher.xml | 9 +++++++++ src/com/android/browser/Controller.java | 2 -- src/com/android/browser/NavigationBarBase.java | 5 +++++ src/com/android/browser/PhoneUi.java | 4 ---- 5 files changed, 23 insertions(+), 24 deletions(-) diff --git a/res/menu/browser.xml b/res/menu/browser.xml index d5bdf04..d3dc7d0 100644 --- a/res/menu/browser.xml +++ b/res/menu/browser.xml @@ -39,36 +39,23 @@ android:title="@string/new_incognito_tab" android:icon="@drawable/ic_new_incognito_holo_dark" /> - + android:id="@+id/bookmarks_menu_id" + android:title="@string/bookmarks" + android:icon="@drawable/ic_bookmarks_history_holo_dark" + android:alphabeticShortcut="b" + android:visible="@bool/menu_show_bookmarks" /> - - + + + + + diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 7c93e9f..cafbafb 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -1518,8 +1518,6 @@ public class Controller counter.setVisible(showDebugSettings); counter.setEnabled(showDebugSettings); - MenuItem saveSnapshot = menu.findItem(R.id.save_snapshot_menu_id); - saveSnapshot.setVisible(tab != null && !tab.isSnapshot()); mUi.updateMenuState(tab, menu); } diff --git a/src/com/android/browser/NavigationBarBase.java b/src/com/android/browser/NavigationBarBase.java index 724dcc8..a4130b8 100644 --- a/src/com/android/browser/NavigationBarBase.java +++ b/src/com/android/browser/NavigationBarBase.java @@ -121,6 +121,11 @@ public class NavigationBarBase extends LinearLayout implements OnClickListener, popup.getMenuInflater().inflate(R.menu.ua_switcher, menu); menu.findItem(R.id.ua_mobile_menu_id).setChecked(!desktop); menu.findItem(R.id.ua_desktop_menu_id).setChecked(desktop); + Tab tab = mUiController.getCurrentTab(); + MenuItem saveSnapshot = menu.findItem(R.id.save_snapshot_menu_id); + saveSnapshot.setVisible(tab != null && !tab.isSnapshot()); + MenuItem find = menu.findItem(R.id.find_menu_id); + find.setVisible(tab != null && !tab.isSnapshot()); popup.setOnMenuItemClickListener(this); popup.show(); } diff --git a/src/com/android/browser/PhoneUi.java b/src/com/android/browser/PhoneUi.java index f33dbef..7321267 100644 --- a/src/com/android/browser/PhoneUi.java +++ b/src/com/android/browser/PhoneUi.java @@ -180,10 +180,6 @@ public class PhoneUi extends BaseUi { if (nt != null) { nt.setVisible(mNavScreen == null); } - MenuItem find = menu.findItem(R.id.find_menu_id); - if (find != null) { - find.setVisible(((tab != null) && !tab.isSnapshot())); - } MenuItem abm = menu.findItem(R.id.add_bookmark_menu_id); if (abm != null) { abm.setVisible((tab != null) && !tab.isSnapshot()); -- cgit v1.1