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

Side by Side 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, 1 month 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/browser_commands.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/toolbar/bookmark_sub_menu_model.h" 5 #include "chrome/browser/ui/toolbar/bookmark_sub_menu_model.h"
6 6
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/grit/generated_resources.h" 8 #include "chrome/grit/generated_resources.h"
9 9
10 // For views and cocoa, we have complex delegate systems to handle 10 // For views and cocoa, we have complex delegate systems to handle
11 // injecting the bookmarks to the bookmark submenu. This is done to support 11 // injecting the bookmarks to the bookmark submenu. This is done to support
12 // advanced interactions with the menu contents, like right click context menus. 12 // advanced interactions with the menu contents, like right click context menus.
13 // For the time being on GTK systems, we have a dedicated bookmark menu model in
14 // chrome/browser/ui/gtk/bookmarks/bookmark_sub_menu_model_gtk.cc instead.
15
16 // Note that although this file's header is included on GTK systems, this
17 // source file is not compiled there. (The header just includes the GTK one.)
18 13
19 BookmarkSubMenuModel::BookmarkSubMenuModel( 14 BookmarkSubMenuModel::BookmarkSubMenuModel(
20 ui::SimpleMenuModel::Delegate* delegate, Browser* browser) 15 ui::SimpleMenuModel::Delegate* delegate, Browser* browser)
21 : SimpleMenuModel(delegate) { 16 : SimpleMenuModel(delegate) {
22 Build(browser); 17 Build(browser);
23 } 18 }
24 19
25 BookmarkSubMenuModel::~BookmarkSubMenuModel() {} 20 BookmarkSubMenuModel::~BookmarkSubMenuModel() {}
26 21
27 void BookmarkSubMenuModel::Build(Browser* browser) { 22 void BookmarkSubMenuModel::Build(Browser* browser) {
28 AddCheckItemWithStringId(IDC_SHOW_BOOKMARK_BAR, IDS_SHOW_BOOKMARK_BAR); 23 AddCheckItemWithStringId(IDC_SHOW_BOOKMARK_BAR, IDS_SHOW_BOOKMARK_BAR);
29 AddItemWithStringId(IDC_SHOW_BOOKMARK_MANAGER, IDS_BOOKMARK_MANAGER); 24 AddItemWithStringId(IDC_SHOW_BOOKMARK_MANAGER, IDS_BOOKMARK_MANAGER);
30 #if !defined(OS_CHROMEOS) 25 #if !defined(OS_CHROMEOS)
31 AddItemWithStringId(IDC_IMPORT_SETTINGS, IDS_IMPORT_SETTINGS_MENU_LABEL); 26 AddItemWithStringId(IDC_IMPORT_SETTINGS, IDS_IMPORT_SETTINGS_MENU_LABEL);
32 #endif 27 #endif
33 if (delegate()->IsCommandIdVisible(IDC_BOOKMARK_PAGE) || 28 bool is_submenu_visible =
34 delegate()->IsCommandIdVisible(IDC_BOOKMARK_ALL_TABS) || 29 delegate()->IsCommandIdVisible(IDC_BOOKMARK_PAGE) ||
35 delegate()->IsCommandIdVisible(IDC_PIN_TO_START_SCREEN)) { 30 delegate()->IsCommandIdVisible(IDC_BOOKMARK_ALL_TABS);
31 #if defined(OS_WIN)
32 is_submenu_visible |=
33 delegate()->IsCommandIdVisible(IDC_PIN_TO_START_SCREEN);
34 #endif
35 if (is_submenu_visible) {
36 AddSeparator(ui::NORMAL_SEPARATOR); 36 AddSeparator(ui::NORMAL_SEPARATOR);
37 37
38 AddItemWithStringId(IDC_BOOKMARK_PAGE, IDS_BOOKMARK_THIS_PAGE); 38 AddItemWithStringId(IDC_BOOKMARK_PAGE, IDS_BOOKMARK_THIS_PAGE);
39 AddItemWithStringId(IDC_BOOKMARK_ALL_TABS, IDS_BOOKMARK_OPEN_PAGES); 39 AddItemWithStringId(IDC_BOOKMARK_ALL_TABS, IDS_BOOKMARK_OPEN_PAGES);
40 40
41 #if defined(OS_WIN)
41 AddItemWithStringId(IDC_PIN_TO_START_SCREEN, IDS_PIN_TO_START_SCREEN); 42 AddItemWithStringId(IDC_PIN_TO_START_SCREEN, IDS_PIN_TO_START_SCREEN);
43 #endif
42 } 44 }
43 #if defined(OS_MACOSX) 45 #if defined(OS_MACOSX)
44 AddSeparator(ui::NORMAL_SEPARATOR); 46 AddSeparator(ui::NORMAL_SEPARATOR);
45 #endif 47 #endif
46 } 48 }
OLDNEW
« 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