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

Unified Diff: chrome/browser/ui/toolbar/bookmark_sub_menu_model.cc

Issue 680313004: Cleanup: Make TogglePinnedToStartScreen() Windows only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/toolbar/bookmark_sub_menu_model.cc
diff --git a/chrome/browser/ui/toolbar/bookmark_sub_menu_model.cc b/chrome/browser/ui/toolbar/bookmark_sub_menu_model.cc
index fbde66feabe79dccfc2b59d10a249d1dbbf38047..3f3d042f79fa3d449ef71ca793ae357be0ab84da 100644
--- a/chrome/browser/ui/toolbar/bookmark_sub_menu_model.cc
+++ b/chrome/browser/ui/toolbar/bookmark_sub_menu_model.cc
@@ -10,11 +10,6 @@
// For views and cocoa, we have complex delegate systems to handle
// injecting the bookmarks to the bookmark submenu. This is done to support
// advanced interactions with the menu contents, like right click context menus.
-// For the time being on GTK systems, we have a dedicated bookmark menu model in
-// chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.cc instead.
-
-// Note that although this file's header is included on GTK systems, this
-// source file is not compiled there. (The header just includes the GTK one.)
BookmarkSubMenuModel::BookmarkSubMenuModel(
ui::SimpleMenuModel::Delegate* delegate, Browser* browser)
@@ -30,15 +25,22 @@ void BookmarkSubMenuModel::Build(Browser* browser) {
#if !defined(OS_CHROMEOS)
AddItemWithStringId(IDC_IMPORT_SETTINGS, IDS_IMPORT_SETTINGS_MENU_LABEL);
#endif
- if (delegate()->IsCommandIdVisible(IDC_BOOKMARK_PAGE) ||
- delegate()->IsCommandIdVisible(IDC_BOOKMARK_ALL_TABS) ||
- delegate()->IsCommandIdVisible(IDC_PIN_TO_START_SCREEN)) {
+ bool is_submenu_visible =
+ delegate()->IsCommandIdVisible(IDC_BOOKMARK_PAGE) ||
+ delegate()->IsCommandIdVisible(IDC_BOOKMARK_ALL_TABS);
+#if defined(OS_WIN)
+ is_submenu_visible |=
+ delegate()->IsCommandIdVisible(IDC_PIN_TO_START_SCREEN);
+#endif
+ if (is_submenu_visible) {
AddSeparator(ui::NORMAL_SEPARATOR);
AddItemWithStringId(IDC_BOOKMARK_PAGE, IDS_BOOKMARK_THIS_PAGE);
AddItemWithStringId(IDC_BOOKMARK_ALL_TABS, IDS_BOOKMARK_OPEN_PAGES);
+#if defined(OS_WIN)
AddItemWithStringId(IDC_PIN_TO_START_SCREEN, IDS_PIN_TO_START_SCREEN);
+#endif
}
#if defined(OS_MACOSX)
AddSeparator(ui::NORMAL_SEPARATOR);
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698