diff options
author | Dave Tharp <dtharp@codeaurora.org> | 2015-05-28 07:38:32 -0700 |
---|---|---|
committer | Dave Tharp <dtharp@codeaurora.org> | 2015-05-28 07:49:58 -0700 |
commit | dcad7b0ef0f46315ec66402715076ecdaf4a5087 (patch) | |
tree | 8fca92de2e192d18627dca75494c3885b7983ec1 /src/com/android/browser/NavScreen.java | |
parent | a3d001de1261fde39df73a9ff41d62b78605d57d (diff) | |
download | android_packages_apps_Gello-dcad7b0ef0f46315ec66402715076ecdaf4a5087.tar.gz android_packages_apps_Gello-dcad7b0ef0f46315ec66402715076ecdaf4a5087.tar.bz2 android_packages_apps_Gello-dcad7b0ef0f46315ec66402715076ecdaf4a5087.zip |
[MDM] Fix for incognito mode menu item
The incognito restriction was correctly gating incognito tab creation when
attempted from the 'new tab' screen, but I had missed the incognito icon
at the top of the menu.
The fix was to modify the IncognitoRestriction class to manage a new type
of control (the menu icon) and to push the gating logic down into the
Controller class (where it really belongs anyway).
Change-Id: I5395f060502907fcc7d03826568af1802450ad1b
Diffstat (limited to 'src/com/android/browser/NavScreen.java')
-rw-r--r-- | src/com/android/browser/NavScreen.java | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/com/android/browser/NavScreen.java b/src/com/android/browser/NavScreen.java index 76d0703f..d8bfd565 100644 --- a/src/com/android/browser/NavScreen.java +++ b/src/com/android/browser/NavScreen.java @@ -33,7 +33,6 @@ import android.widget.LinearLayout; import android.widget.PopupMenu; import android.widget.PopupMenu.OnMenuItemClickListener; import android.widget.RelativeLayout; -import android.widget.Toast; import com.android.browser.NavTabScroller.OnRemoveListener; import com.android.browser.mdm.IncognitoRestriction; @@ -117,7 +116,7 @@ public class NavScreen extends RelativeLayout R.string.accessibility_transition_navscreen)); mToolbarLayout = findViewById(R.id.nav_toolbar_animate); mNewIncognitoTab = (ImageButton) findViewById(R.id.newincognitotab); - IncognitoRestriction.getInstance().registerButton(mNewIncognitoTab); + IncognitoRestriction.getInstance().registerControl(mNewIncognitoTab); mNewTab = (ImageButton) findViewById(R.id.newtab); mMore = (ImageButton) findViewById(R.id.more); mNewIncognitoTab.setOnClickListener(this); @@ -149,11 +148,7 @@ public class NavScreen extends RelativeLayout if (mNewTab == v) { openNewTab(); } else if (mNewIncognitoTab == v) { - if (IncognitoRestriction.getInstance().isEnabled()) { - Toast.makeText(getContext(), R.string.mdm_managed_alert, Toast.LENGTH_SHORT).show(); - } else { - openNewIncognitoTab(); - } + openNewIncognitoTab(); } else if (mMore == v) { showPopupMenu(); } |