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(); |