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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm

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/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;
}
}

Powered by Google App Engine
This is Rietveld 408576698