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

Side by Side Diff: chrome/browser/ui/bookmarks/bookmark_context_menu_controller.h

Issue 2809003002: Making bookmark folder context menu display the number of bookmarks that will be opened by Open All (Closed)
Patch Set: All changes to add count to context menu Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 bool IsItemForCommandIdDynamic(int command_id) const override; 71 bool IsItemForCommandIdDynamic(int command_id) const override;
72 base::string16 GetLabelForCommandId(int command_id) const override; 72 base::string16 GetLabelForCommandId(int command_id) const override;
73 73
74 void set_navigator(content::PageNavigator* navigator) { 74 void set_navigator(content::PageNavigator* navigator) {
75 navigator_ = navigator; 75 navigator_ = navigator;
76 } 76 }
77 77
78 private: 78 private:
79 void BuildMenu(); 79 void BuildMenu();
80 80
81 // Adds a IDC_* style command to the menu with a string16.
82 void AddItem(int id, base::string16 str);
Peter Kasting 2017/04/13 04:52:09 Nit: Pass by const ref
Paezagon 2017/04/14 01:00:29 Done.
81 // Adds a IDC_* style command to the menu with a localized string. 83 // Adds a IDC_* style command to the menu with a localized string.
82 void AddItem(int id, int localization_id); 84 void AddItem(int id, int localization_id);
83 // Adds a separator to the menu. 85 // Adds a separator to the menu.
84 void AddSeparator(); 86 void AddSeparator();
85 // Adds a checkable item to the menu. 87 // Adds a checkable item to the menu.
86 void AddCheckboxItem(int id, int localization_id); 88 void AddCheckboxItem(int id, int localization_id);
87 89
88 // Overridden from bookmarks::BaseBookmarkModelObserver: 90 // Overridden from bookmarks::BaseBookmarkModelObserver:
89 // Any change to the model results in closing the menu. 91 // Any change to the model results in closing the menu.
90 void BookmarkModelChanged() override; 92 void BookmarkModelChanged() override;
91 93
92 gfx::NativeWindow parent_window_; 94 gfx::NativeWindow parent_window_;
93 BookmarkContextMenuControllerDelegate* delegate_; 95 BookmarkContextMenuControllerDelegate* delegate_;
94 Browser* browser_; 96 Browser* browser_;
95 Profile* profile_; 97 Profile* profile_;
96 content::PageNavigator* navigator_; 98 content::PageNavigator* navigator_;
97 const bookmarks::BookmarkNode* parent_; 99 const bookmarks::BookmarkNode* parent_;
98 std::vector<const bookmarks::BookmarkNode*> selection_; 100 std::vector<const bookmarks::BookmarkNode*> selection_;
99 bookmarks::BookmarkModel* model_; 101 bookmarks::BookmarkModel* model_;
100 std::unique_ptr<ui::SimpleMenuModel> menu_model_; 102 std::unique_ptr<ui::SimpleMenuModel> menu_model_;
101 // Used to detect deletion of |this| executing a command. 103 // Used to detect deletion of |this| executing a command.
102 base::WeakPtrFactory<BookmarkContextMenuController> weak_factory_; 104 base::WeakPtrFactory<BookmarkContextMenuController> weak_factory_;
103 105
104 DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenuController); 106 DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenuController);
105 }; 107 };
106 108
107 #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_ 109 #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698