| 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_VIEWS_BOOKMARKS_BOOKMARK_MENU_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_DELEGATE_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 // Don't show any additional folders. | 50 // Don't show any additional folders. |
| 51 HIDE_PERMANENT_FOLDERS | 51 HIDE_PERMANENT_FOLDERS |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 BookmarkMenuDelegate(Browser* browser, | 54 BookmarkMenuDelegate(Browser* browser, |
| 55 content::PageNavigator* navigator, | 55 content::PageNavigator* navigator, |
| 56 views::Widget* parent, | 56 views::Widget* parent, |
| 57 int first_menu_id, | 57 int first_menu_id, |
| 58 int max_menu_id); | 58 int max_menu_id); |
| 59 virtual ~BookmarkMenuDelegate(); | 59 ~BookmarkMenuDelegate() override; |
| 60 | 60 |
| 61 // Creates the menus from the model. | 61 // Creates the menus from the model. |
| 62 void Init(views::MenuDelegate* real_delegate, | 62 void Init(views::MenuDelegate* real_delegate, |
| 63 views::MenuItemView* parent, | 63 views::MenuItemView* parent, |
| 64 const BookmarkNode* node, | 64 const BookmarkNode* node, |
| 65 int start_child_index, | 65 int start_child_index, |
| 66 ShowOptions show_options, | 66 ShowOptions show_options, |
| 67 BookmarkLaunchLocation location); | 67 BookmarkLaunchLocation location); |
| 68 | 68 |
| 69 // Sets the PageNavigator. | 69 // Sets the PageNavigator. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 bool ShowContextMenu(views::MenuItemView* source, | 115 bool ShowContextMenu(views::MenuItemView* source, |
| 116 int id, | 116 int id, |
| 117 const gfx::Point& p, | 117 const gfx::Point& p, |
| 118 ui::MenuSourceType source_type); | 118 ui::MenuSourceType source_type); |
| 119 bool CanDrag(views::MenuItemView* menu); | 119 bool CanDrag(views::MenuItemView* menu); |
| 120 void WriteDragData(views::MenuItemView* sender, ui::OSExchangeData* data); | 120 void WriteDragData(views::MenuItemView* sender, ui::OSExchangeData* data); |
| 121 int GetDragOperations(views::MenuItemView* sender); | 121 int GetDragOperations(views::MenuItemView* sender); |
| 122 int GetMaxWidthForMenu(views::MenuItemView* menu); | 122 int GetMaxWidthForMenu(views::MenuItemView* menu); |
| 123 | 123 |
| 124 // BookmarkModelObserver methods. | 124 // BookmarkModelObserver methods. |
| 125 virtual void BookmarkModelChanged() override; | 125 void BookmarkModelChanged() override; |
| 126 virtual void BookmarkNodeFaviconChanged(BookmarkModel* model, | 126 void BookmarkNodeFaviconChanged(BookmarkModel* model, |
| 127 const BookmarkNode* node) override; | 127 const BookmarkNode* node) override; |
| 128 | 128 |
| 129 // BookmarkContextMenu::Observer methods. | 129 // BookmarkContextMenu::Observer methods. |
| 130 virtual void WillRemoveBookmarks( | 130 void WillRemoveBookmarks( |
| 131 const std::vector<const BookmarkNode*>& bookmarks) override; | 131 const std::vector<const BookmarkNode*>& bookmarks) override; |
| 132 virtual void DidRemoveBookmarks() override; | 132 void DidRemoveBookmarks() override; |
| 133 | 133 |
| 134 private: | 134 private: |
| 135 typedef std::map<int, const BookmarkNode*> MenuIDToNodeMap; | 135 typedef std::map<int, const BookmarkNode*> MenuIDToNodeMap; |
| 136 typedef std::map<const BookmarkNode*, views::MenuItemView*> NodeToMenuMap; | 136 typedef std::map<const BookmarkNode*, views::MenuItemView*> NodeToMenuMap; |
| 137 | 137 |
| 138 // Creates a menu. This uses BuildMenu() to recursively populate the menu. | 138 // Creates a menu. This uses BuildMenu() to recursively populate the menu. |
| 139 views::MenuItemView* CreateMenu(const BookmarkNode* parent, | 139 views::MenuItemView* CreateMenu(const BookmarkNode* parent, |
| 140 int start_child_index, | 140 int start_child_index, |
| 141 ShowOptions show_options); | 141 ShowOptions show_options); |
| 142 | 142 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // Is the model being changed? | 207 // Is the model being changed? |
| 208 bool is_mutating_model_; | 208 bool is_mutating_model_; |
| 209 | 209 |
| 210 // The location where this bookmark menu will be displayed (for UMA). | 210 // The location where this bookmark menu will be displayed (for UMA). |
| 211 BookmarkLaunchLocation location_; | 211 BookmarkLaunchLocation location_; |
| 212 | 212 |
| 213 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuDelegate); | 213 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuDelegate); |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_DELEGATE_H_ | 216 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_DELEGATE_H_ |
| OLD | NEW |