Commit 1f42285a authored by Jeffrey's avatar Jeffrey Committed by Commit Bot

Update 'Always Show Bookmarks' checkmark visibility when toggled on New

Tab Page

In MacViews mode, the 'Always Show Bookmarks' menu item is always checked
regardless of whether the bookmark bar is detached or attached. In Cocoa
mode, this was not an issue because the visibility state is determined by the
bookmark preference value for 'kShowBookmarkBar', which stores whether the
'Always Show Bookmarks' option is checked. In MacViews mode, the visibility
state always returns 'true' because it calls IsBookmarkBarVisible() instead,
which is 'true' if the bookmark bar is in a detached state (on New Tab Page).

Add contact info to AUTHORS


Update 'Always Show Bookmarks' checkmark visibility when toggled on New Tab Page

R=bsep@chromium.org, sky@chromium.org

Bug: 854962
Change-Id: I19f3741cd720474642d0661192f92f4517da075c
Reviewed-on: https://chromium-review.googlesource.com/1123890
Commit-Queue: Sidney San Martín <sdy@chromium.org>
Reviewed-by: default avatarSidney San Martín <sdy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#572236}
parent 2867a716
......@@ -371,6 +371,7 @@ Jari Karppanen <jkarp@amazon.com>
Jay Oster <jay@kodewerx.org>
Jay Soffian <jaysoffian@gmail.com>
Jeado Ko <haibane84@gmail.com>
Jeffrey C <jeffreyca16@gmail.com>
Jeongeun Kim <je_julie.kim@samsung.com>
Jeongmin Kim <kimwjdalsl@gmail.com>
Jeongwoo Park <skeksk91@gmail.com>
......
......@@ -19,6 +19,7 @@
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "content/public/browser/web_contents.h"
#import "ui/base/cocoa/cocoa_base_utils.h"
#include "ui/base/l10n/l10n_util.h"
......@@ -49,7 +50,8 @@ void UpdateToggleStateWithTag(NSInteger tag, id item, NSWindow* window) {
// On Windows this logic happens in bookmark_bar_view.cc. This simply updates
// the menu item; it does not display the bookmark bar itself.
if (tag == IDC_SHOW_BOOKMARK_BAR) {
SetToggleState(browser->window()->IsBookmarkBarVisible(), item);
PrefService* prefs = browser->profile()->GetPrefs();
SetToggleState(prefs->GetBoolean(bookmarks::prefs::kShowBookmarkBar), item);
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment