Bug 896121 - Disable share in guest mode for the awesomescreen. r=mfinkle
authorWes Johnston <wjohnston@mozilla.com>
Mon, 26 Aug 2013 16:41:15 -0700
changeset 144419 b46cafdfc8ba4fd9e6f273e439189087d10a4998
parent 144418 8870bca1edd3f6718794907726172257f11999b1
child 144420 f30dadf4c9377ec1c2b516d72315eb5d200cfa48
push id25161
push userttaubert@mozilla.com
push dateTue, 27 Aug 2013 05:56:58 +0000
treeherdermozilla-central@e42dce3209da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs896121
milestone26.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 896121 - Disable share in guest mode for the awesomescreen. r=mfinkle
mobile/android/base/home/HomeFragment.java
--- a/mobile/android/base/home/HomeFragment.java
+++ b/mobile/android/base/home/HomeFragment.java
@@ -4,16 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.home;
 
 import org.mozilla.gecko.EditBookmarkDialog;
 import org.mozilla.gecko.Favicons;
 import org.mozilla.gecko.GeckoAppShell;
 import org.mozilla.gecko.GeckoEvent;
+import org.mozilla.gecko.GeckoProfile;
 import org.mozilla.gecko.R;
 import org.mozilla.gecko.ReaderModeUtils;
 import org.mozilla.gecko.Tabs;
 import org.mozilla.gecko.db.BrowserContract.Combined;
 import org.mozilla.gecko.db.BrowserDB;
 import org.mozilla.gecko.gfx.BitmapUtils;
 import org.mozilla.gecko.home.HomeListView.HomeContextMenuInfo;
 import org.mozilla.gecko.util.ThreadUtils;
@@ -93,16 +94,18 @@ abstract class HomeFragment extends Frag
             menu.findItem(R.id.home_edit_bookmark).setVisible(false);
         }
 
         // Hide the "Remove" menuitem if this item doesn't have a bookmark or history ID.
         if (info.bookmarkId < 0 && info.historyId < 0) {
             menu.findItem(R.id.home_remove).setVisible(false);
         }
 
+        menu.findItem(R.id.home_share).setVisible(!GeckoProfile.get(getActivity()).inGuestMode());
+
         final boolean canOpenInReader = (info.display == Combined.DISPLAY_READER);
         menu.findItem(R.id.home_open_in_reader).setVisible(canOpenInReader);
     }
 
     @Override
     public boolean onContextItemSelected(MenuItem item) {
         // onContextItemSelected() is first dispatched to the activity and
         // then dispatched to its fragments. Since fragments cannot "override"