| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 void WriteDragData(views::MenuItemView* sender, ui::OSExchangeData* data); | 129 void WriteDragData(views::MenuItemView* sender, ui::OSExchangeData* data); |
| 130 int GetDragOperations(views::MenuItemView* sender); | 130 int GetDragOperations(views::MenuItemView* sender); |
| 131 int GetMaxWidthForMenu(views::MenuItemView* menu); | 131 int GetMaxWidthForMenu(views::MenuItemView* menu); |
| 132 void WillShowMenu(views::MenuItemView* menu); | 132 void WillShowMenu(views::MenuItemView* menu); |
| 133 | 133 |
| 134 // BookmarkModelObserver methods. | 134 // BookmarkModelObserver methods. |
| 135 void BookmarkModelChanged() override; | 135 void BookmarkModelChanged() override; |
| 136 void BookmarkNodeFaviconChanged(bookmarks::BookmarkModel* model, | 136 void BookmarkNodeFaviconChanged(bookmarks::BookmarkModel* model, |
| 137 const bookmarks::BookmarkNode* node) override; | 137 const bookmarks::BookmarkNode* node) override; |
| 138 | 138 |
| 139 // BookmarkContextMenu::Observer methods. | 139 // BookmarkContextMenuObserver methods. |
| 140 void WillRemoveBookmarks( | 140 void WillRemoveBookmarks( |
| 141 const std::vector<const bookmarks::BookmarkNode*>& bookmarks) override; | 141 const std::vector<const bookmarks::BookmarkNode*>& bookmarks) override; |
| 142 void DidRemoveBookmarks() override; | 142 void DidRemoveBookmarks() override; |
| 143 void OnContextMenuClosed() override; |
| 143 | 144 |
| 144 private: | 145 private: |
| 145 friend class BookmarkMenuDelegateTest; | 146 friend class BookmarkMenuDelegateTest; |
| 146 | 147 |
| 147 typedef std::map<int, const bookmarks::BookmarkNode*> MenuIDToNodeMap; | 148 typedef std::map<int, const bookmarks::BookmarkNode*> MenuIDToNodeMap; |
| 148 typedef std::map<const bookmarks::BookmarkNode*, views::MenuItemView*> | 149 typedef std::map<const bookmarks::BookmarkNode*, views::MenuItemView*> |
| 149 NodeToMenuMap; | 150 NodeToMenuMap; |
| 150 | 151 |
| 151 // Returns whether the menu should close id 'delete' is selected. | 152 // Returns whether the menu should close id 'delete' is selected. |
| 152 bool ShouldCloseOnRemove(const bookmarks::BookmarkNode* node) const; | 153 bool ShouldCloseOnRemove(const bookmarks::BookmarkNode* node) const; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // Is the model being changed? | 217 // Is the model being changed? |
| 217 bool is_mutating_model_; | 218 bool is_mutating_model_; |
| 218 | 219 |
| 219 // The location where this bookmark menu will be displayed (for UMA). | 220 // The location where this bookmark menu will be displayed (for UMA). |
| 220 BookmarkLaunchLocation location_; | 221 BookmarkLaunchLocation location_; |
| 221 | 222 |
| 222 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuDelegate); | 223 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuDelegate); |
| 223 }; | 224 }; |
| 224 | 225 |
| 225 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_DELEGATE_H_ | 226 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_DELEGATE_H_ |
| OLD | NEW |