| Index: chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
|
| diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
|
| index e88fde15ea5f03da7d602b46c585e3ba866f2510..ec5ddf4e877b26c09cd504ea33faf324f645adf9 100644
|
| --- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
|
| +++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h
|
| @@ -53,7 +53,8 @@ class BookmarkMenuDelegate : public BaseBookmarkModelObserver,
|
| BookmarkMenuDelegate(Browser* browser,
|
| content::PageNavigator* navigator,
|
| views::Widget* parent,
|
| - int first_menu_id);
|
| + int first_menu_id,
|
| + int max_menu_id);
|
| virtual ~BookmarkMenuDelegate();
|
|
|
| // Creates the menus from the model.
|
| @@ -129,6 +130,9 @@ class BookmarkMenuDelegate : public BaseBookmarkModelObserver,
|
| virtual void DidRemoveBookmarks() OVERRIDE;
|
|
|
| private:
|
| + friend class BookmarkMenuDelegateTest;
|
| + FRIEND_TEST_ALL_PREFIXES(BookmarkMenuDelegateTest, MenuIdRange);
|
| +
|
| typedef std::map<int, const BookmarkNode*> MenuIDToNodeMap;
|
| typedef std::map<const BookmarkNode*, views::MenuItemView*> NodeToMenuMap;
|
|
|
| @@ -158,6 +162,10 @@ class BookmarkMenuDelegate : public BaseBookmarkModelObserver,
|
| views::MenuItemView* menu,
|
| int* next_menu_id);
|
|
|
| + // Returns true if |menu_id_| is outside the range of minimum and maximum menu
|
| + // ID's allowed.
|
| + bool IsOutsideMenuIdRange(int menu_id) const;
|
| +
|
| Browser* browser_;
|
| Profile* profile_;
|
|
|
| @@ -190,6 +198,10 @@ class BookmarkMenuDelegate : public BaseBookmarkModelObserver,
|
| // ID of the next menu item.
|
| int next_menu_id_;
|
|
|
| + // Minimum and maximum ID's to use for menu items.
|
| + const int min_menu_id_;
|
| + const int max_menu_id_;
|
| +
|
| views::MenuDelegate* real_delegate_;
|
|
|
| // Is the model being changed?
|
|
|