OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_vie
ws.h" | 9 #include "chrome/browser/ui/views/bookmarks/bookmark_context_menu_controller_vie
ws.h" |
10 #include "views/controls/menu/menu_delegate.h" | 10 #include "views/controls/menu/menu_delegate.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 }; | 24 }; |
25 | 25 |
26 class BookmarkContextMenu : public BookmarkContextMenuControllerViewsDelegate, | 26 class BookmarkContextMenu : public BookmarkContextMenuControllerViewsDelegate, |
27 public views::MenuDelegate { | 27 public views::MenuDelegate { |
28 public: | 28 public: |
29 BookmarkContextMenu( | 29 BookmarkContextMenu( |
30 gfx::NativeWindow parent_window, | 30 gfx::NativeWindow parent_window, |
31 Profile* profile, | 31 Profile* profile, |
32 PageNavigator* page_navigator, | 32 PageNavigator* page_navigator, |
33 const BookmarkNode* parent, | 33 const BookmarkNode* parent, |
34 const std::vector<const BookmarkNode*>& selection); | 34 const std::vector<const BookmarkNode*>& selection, |
| 35 bool close_on_remove); |
35 virtual ~BookmarkContextMenu(); | 36 virtual ~BookmarkContextMenu(); |
36 | 37 |
37 // Shows the context menu at the specified point. | 38 // Shows the context menu at the specified point. |
38 void RunMenuAt(const gfx::Point& point); | 39 void RunMenuAt(const gfx::Point& point); |
39 | 40 |
40 views::MenuItemView* menu() const { return menu_.get(); } | 41 views::MenuItemView* menu() const { return menu_.get(); } |
41 | 42 |
42 void set_observer(BookmarkContextMenuObserver* observer) { | 43 void set_observer(BookmarkContextMenuObserver* observer) { |
43 observer_ = observer; | 44 observer_ = observer; |
44 } | 45 } |
(...skipping 20 matching lines...) Expand all Loading... |
65 gfx::NativeWindow parent_window_; | 66 gfx::NativeWindow parent_window_; |
66 | 67 |
67 // The menu itself. | 68 // The menu itself. |
68 scoped_ptr<views::MenuItemView> menu_; | 69 scoped_ptr<views::MenuItemView> menu_; |
69 | 70 |
70 // The node we're showing the menu for. | 71 // The node we're showing the menu for. |
71 const BookmarkNode* parent_node_; | 72 const BookmarkNode* parent_node_; |
72 | 73 |
73 BookmarkContextMenuObserver* observer_; | 74 BookmarkContextMenuObserver* observer_; |
74 | 75 |
| 76 // Should the menu close when a node is removed. |
| 77 bool close_on_remove_; |
| 78 |
75 DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenu); | 79 DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenu); |
76 }; | 80 }; |
77 | 81 |
78 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ | 82 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ |
OLD | NEW |