OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_H_ |
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "chrome/browser/bookmarks/base_bookmark_model_observer.h" | 10 #include "chrome/browser/bookmarks/base_bookmark_model_observer.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 virtual void BookmarkMenuDeleted(BookmarkMenuController* controller) = 0; | 32 virtual void BookmarkMenuDeleted(BookmarkMenuController* controller) = 0; |
33 }; | 33 }; |
34 | 34 |
35 // Creates a BookmarkMenuController showing the children of |node| starting | 35 // Creates a BookmarkMenuController showing the children of |node| starting |
36 // at index |start_child_index|. | 36 // at index |start_child_index|. |
37 BookmarkMenuController(Browser* browser, | 37 BookmarkMenuController(Browser* browser, |
38 Profile* profile, | 38 Profile* profile, |
39 PageNavigator* page_navigator, | 39 PageNavigator* page_navigator, |
40 HWND hwnd, | 40 HWND hwnd, |
41 BookmarkNode* node, | 41 BookmarkNode* node, |
42 int start_child_index); | 42 int start_child_index, |
| 43 bool show_other_folder); |
43 | 44 |
44 // Shows the menu. | 45 // Shows the menu. |
45 void RunMenuAt(const gfx::Rect& bounds, | 46 void RunMenuAt(const gfx::Rect& bounds, |
46 views::MenuItemView::AnchorPosition position, | 47 views::MenuItemView::AnchorPosition position, |
47 bool for_drop); | 48 bool for_drop); |
48 | 49 |
49 // Hides the menu. | 50 // Hides the menu. |
50 void Cancel(); | 51 void Cancel(); |
51 | 52 |
52 // Returns the node the menu is showing for. | 53 // Returns the node the menu is showing for. |
(...skipping 30 matching lines...) Expand all Loading... |
83 virtual int GetDragOperations(views::MenuItemView* sender); | 84 virtual int GetDragOperations(views::MenuItemView* sender); |
84 | 85 |
85 virtual void BookmarkModelChanged(); | 86 virtual void BookmarkModelChanged(); |
86 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, | 87 virtual void BookmarkNodeFavIconLoaded(BookmarkModel* model, |
87 BookmarkNode* node); | 88 BookmarkNode* node); |
88 | 89 |
89 private: | 90 private: |
90 // BookmarkMenuController deletes itself as necessary. | 91 // BookmarkMenuController deletes itself as necessary. |
91 ~BookmarkMenuController(); | 92 ~BookmarkMenuController(); |
92 | 93 |
| 94 // Builds the menu for the other bookmarks folder. This is added as the last |
| 95 // item to menu_. |
| 96 void BuildOtherFolderMenu(int* next_menu_id); |
| 97 |
93 // Creates an entry in menu for each child node of |parent| starting at | 98 // Creates an entry in menu for each child node of |parent| starting at |
94 // |start_child_index|. | 99 // |start_child_index|. |
95 void BuildMenu(BookmarkNode* parent, | 100 void BuildMenu(BookmarkNode* parent, |
96 int start_child_index, | 101 int start_child_index, |
97 views::MenuItemView* menu, | 102 views::MenuItemView* menu, |
98 int* next_menu_id); | 103 int* next_menu_id); |
99 | 104 |
100 Browser* browser_; | 105 Browser* browser_; |
101 | 106 |
102 Profile* profile_; | 107 Profile* profile_; |
(...skipping 21 matching lines...) Expand all Loading... |
124 | 129 |
125 // Used when a context menu is shown. | 130 // Used when a context menu is shown. |
126 scoped_ptr<BookmarkContextMenu> context_menu_; | 131 scoped_ptr<BookmarkContextMenu> context_menu_; |
127 | 132 |
128 // The observer, may be null. | 133 // The observer, may be null. |
129 Observer* observer_; | 134 Observer* observer_; |
130 | 135 |
131 // Is the menu being shown for a drop? | 136 // Is the menu being shown for a drop? |
132 bool for_drop_; | 137 bool for_drop_; |
133 | 138 |
| 139 // Should the other folder be shown? |
| 140 bool show_other_folder_; |
| 141 |
134 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); | 142 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuController); |
135 }; | 143 }; |
136 | 144 |
137 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_H_ | 145 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_MENU_CONTROLLER_H_ |
OLD | NEW |