Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(231)

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 7520023: Converted IncognitoForced boolean policy into IncognitoModeAvailability enum policy. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/tab_contents/render_view_context_menu.cc
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index aa46b851c6490ca0e8279db0daa6663375aa6170..1df1fec1393d6b2a97f490130a685f0806ee47d8 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -28,6 +28,7 @@
#include "chrome/browser/net/browser_url_util.h"
#include "chrome/browser/page_info_window.h"
#include "chrome/browser/platform_util.h"
+#include "chrome/browser/prefs/incognito_mode_availability_prefs.h"
#include "chrome/browser/prefs/pref_member.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -1014,8 +1015,12 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
}
case IDC_CONTENT_CONTEXT_OPENLINKNEWTAB:
- case IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW:
return params_.link_url.is_valid();
+ case IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW:
+ return params_.link_url.is_valid() &&
+ profile_->GetPrefs()->GetInteger(
+ prefs::kIncognitoModeAvailability) !=
+ IncognitoModeAvailabilityPrefs::FORCED;
case IDC_CONTENT_CONTEXT_COPYLINKLOCATION:
return params_.unfiltered_link_url.is_valid();
@@ -1139,7 +1144,9 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD:
return !profile_->IsOffTheRecord() && params_.link_url.is_valid() &&
- profile_->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled);
+ profile_->GetPrefs()->GetInteger(
+ prefs::kIncognitoModeAvailability) !=
+ IncognitoModeAvailabilityPrefs::DISABLED;
case IDC_SPELLCHECK_ADD_TO_DICTIONARY:
return !params_.misspelled_word.empty();

Powered by Google App Engine
This is Rietveld 408576698