OLD | NEW |
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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 Browser* browser, | 55 Browser* browser, |
56 Profile* profile, | 56 Profile* profile, |
57 content::PageNavigator* navigator, | 57 content::PageNavigator* navigator, |
58 const BookmarkNode* parent, | 58 const BookmarkNode* parent, |
59 const std::vector<const BookmarkNode*>& selection); | 59 const std::vector<const BookmarkNode*>& selection); |
60 virtual ~BookmarkContextMenuController(); | 60 virtual ~BookmarkContextMenuController(); |
61 | 61 |
62 ui::SimpleMenuModel* menu_model() { return menu_model_.get(); } | 62 ui::SimpleMenuModel* menu_model() { return menu_model_.get(); } |
63 | 63 |
64 // ui::SimpleMenuModel::Delegate implementation: | 64 // ui::SimpleMenuModel::Delegate implementation: |
65 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 65 virtual bool IsCommandIdChecked(int command_id) const override; |
66 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 66 virtual bool IsCommandIdEnabled(int command_id) const override; |
67 virtual bool IsCommandIdVisible(int command_id) const OVERRIDE; | 67 virtual bool IsCommandIdVisible(int command_id) const override; |
68 virtual bool GetAcceleratorForCommandId( | 68 virtual bool GetAcceleratorForCommandId( |
69 int command_id, | 69 int command_id, |
70 ui::Accelerator* accelerator) OVERRIDE; | 70 ui::Accelerator* accelerator) override; |
71 virtual void ExecuteCommand(int command_id, int event_flags) OVERRIDE; | 71 virtual void ExecuteCommand(int command_id, int event_flags) override; |
72 virtual bool IsItemForCommandIdDynamic(int command_id) const OVERRIDE; | 72 virtual bool IsItemForCommandIdDynamic(int command_id) const override; |
73 virtual base::string16 GetLabelForCommandId(int command_id) const OVERRIDE; | 73 virtual base::string16 GetLabelForCommandId(int command_id) const override; |
74 | 74 |
75 void set_navigator(content::PageNavigator* navigator) { | 75 void set_navigator(content::PageNavigator* navigator) { |
76 navigator_ = navigator; | 76 navigator_ = navigator; |
77 } | 77 } |
78 | 78 |
79 private: | 79 private: |
80 void BuildMenu(); | 80 void BuildMenu(); |
81 | 81 |
82 // Adds a IDC_* style command to the menu with a localized string. | 82 // Adds a IDC_* style command to the menu with a localized string. |
83 void AddItem(int id, int localization_id); | 83 void AddItem(int id, int localization_id); |
84 // Adds a separator to the menu. | 84 // Adds a separator to the menu. |
85 void AddSeparator(); | 85 void AddSeparator(); |
86 // Adds a checkable item to the menu. | 86 // Adds a checkable item to the menu. |
87 void AddCheckboxItem(int id, int localization_id); | 87 void AddCheckboxItem(int id, int localization_id); |
88 | 88 |
89 // Overridden from BaseBookmarkModelObserver: | 89 // Overridden from BaseBookmarkModelObserver: |
90 // Any change to the model results in closing the menu. | 90 // Any change to the model results in closing the menu. |
91 virtual void BookmarkModelChanged() OVERRIDE; | 91 virtual void BookmarkModelChanged() override; |
92 | 92 |
93 gfx::NativeWindow parent_window_; | 93 gfx::NativeWindow parent_window_; |
94 BookmarkContextMenuControllerDelegate* delegate_; | 94 BookmarkContextMenuControllerDelegate* delegate_; |
95 Browser* browser_; | 95 Browser* browser_; |
96 Profile* profile_; | 96 Profile* profile_; |
97 content::PageNavigator* navigator_; | 97 content::PageNavigator* navigator_; |
98 const BookmarkNode* parent_; | 98 const BookmarkNode* parent_; |
99 std::vector<const BookmarkNode*> selection_; | 99 std::vector<const BookmarkNode*> selection_; |
100 BookmarkModel* model_; | 100 BookmarkModel* model_; |
101 scoped_ptr<ui::SimpleMenuModel> menu_model_; | 101 scoped_ptr<ui::SimpleMenuModel> menu_model_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenuController); | 103 DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenuController); |
104 }; | 104 }; |
105 | 105 |
106 #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_ | 106 #endif // CHROME_BROWSER_UI_BOOKMARKS_BOOKMARK_CONTEXT_MENU_CONTROLLER_H_ |
OLD | NEW |