Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm |
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm |
index 5bdd2cf7085487f8d435e80735591888d822f3d6..6b1f3ca217d8c766938e138491499de9be13b2aa 100644 |
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm |
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm |
@@ -1085,12 +1085,23 @@ void RecordAppLaunch(Profile* profile, GURL url) { |
return NO; |
} |
+ Profile* profile = browser_->profile(); |
// If this is an incognito window, don't allow "open in incognito". |
if ((action == @selector(openBookmarkInIncognitoWindow:)) || |
(action == @selector(openAllBookmarksIncognitoWindow:))) { |
- Profile* profile = browser_->profile(); |
if (profile->IsOffTheRecord() || |
- !profile->GetPrefs()->GetBoolean(prefs::kIncognitoEnabled)) { |
+ profile->GetPrefs()->GetInteger(prefs::kIncognitoModeAvailability) == |
+ IncognitoModeAvailabilityPrefs::DISABLED) { |
+ return NO; |
+ } |
+ } |
+ |
+ // If Incognito mode is forced, do not let open bookmarks in normal window. |
+ if ((action == @selector(openBookmark:)) || |
+ (action == @selector(openAllBookmarksNewWindow:)) || |
+ (action == @selector(openAllBookmarks:))) { |
+ if (profile->GetPrefs()->GetInteger(prefs::kIncognitoModeAvailability) == |
+ IncognitoModeAvailabilityPrefs::FORCED) { |
return NO; |
} |
} |