| 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..46ebf24cc68febe89a9e4ec8f5160de9fae2f4ce 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_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,11 @@ 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() &&
|
| + IncognitoModePrefs::GetAvailability(profile_->GetPrefs()) !=
|
| + IncognitoModePrefs::FORCED;
|
|
|
| case IDC_CONTENT_CONTEXT_COPYLINKLOCATION:
|
| return params_.unfiltered_link_url.is_valid();
|
| @@ -1139,7 +1143,8 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
|
|
|
| case IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD:
|
| return !profile_->IsOffTheRecord() && params_.link_url.is_valid() &&
|
| - profile_->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled);
|
| + IncognitoModePrefs::GetAvailability(profile_->GetPrefs()) !=
|
| + IncognitoModePrefs::DISABLED;
|
|
|
| case IDC_SPELLCHECK_ADD_TO_DICTIONARY:
|
| return !params_.misspelled_word.empty();
|
|
|