| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_CONTEXT_MENU_H_ | 5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ |
| 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ | 6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // Returns the menu. | 71 // Returns the menu. |
| 72 views::MenuItemView* menu() const { return menu_.get(); } | 72 views::MenuItemView* menu() const { return menu_.get(); } |
| 73 #elif defined(OS_LINUX) | 73 #elif defined(OS_LINUX) |
| 74 // Pops up this menu. This call doesn't block. | 74 // Pops up this menu. This call doesn't block. |
| 75 void PopupAsContext(guint32 event_time); | 75 void PopupAsContext(guint32 event_time); |
| 76 | 76 |
| 77 // Returns the menu. | 77 // Returns the menu. |
| 78 GtkWidget* menu() const { return menu_->widget(); } | 78 GtkWidget* menu() const { return menu_->widget(); } |
| 79 #endif | 79 #endif |
| 80 | 80 |
| 81 void set_parent(BookmarkNode* parent) { parent_ = parent; } | |
| 82 | |
| 83 void set_selection(const std::vector<BookmarkNode*>& selection) { | |
| 84 selection_ = selection; | |
| 85 } | |
| 86 | |
| 87 // Menu::Delegate / MenuGtk::Delegate methods. | 81 // Menu::Delegate / MenuGtk::Delegate methods. |
| 88 virtual void ExecuteCommand(int id); | 82 virtual void ExecuteCommand(int id); |
| 89 virtual bool IsItemChecked(int id) const; | 83 virtual bool IsItemChecked(int id) const; |
| 90 virtual bool IsCommandEnabled(int id) const; | 84 virtual bool IsCommandEnabled(int id) const; |
| 91 | 85 |
| 92 private: | 86 private: |
| 93 // BookmarkModelObserver method. Any change to the model results in closing | 87 // BookmarkModelObserver method. Any change to the model results in closing |
| 94 // the menu. | 88 // the menu. |
| 95 virtual void Loaded(BookmarkModel* model) {} | 89 virtual void Loaded(BookmarkModel* model) {} |
| 96 virtual void BookmarkModelBeingDeleted(BookmarkModel* model); | 90 virtual void BookmarkModelBeingDeleted(BookmarkModel* model); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 #if defined(OS_WIN) || defined(TOOLKIT_VIEWS) | 145 #if defined(OS_WIN) || defined(TOOLKIT_VIEWS) |
| 152 scoped_ptr<views::MenuItemView> menu_; | 146 scoped_ptr<views::MenuItemView> menu_; |
| 153 #elif defined(OS_LINUX) | 147 #elif defined(OS_LINUX) |
| 154 scoped_ptr<MenuGtk> menu_; | 148 scoped_ptr<MenuGtk> menu_; |
| 155 #endif | 149 #endif |
| 156 | 150 |
| 157 DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenu); | 151 DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenu); |
| 158 }; | 152 }; |
| 159 | 153 |
| 160 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ | 154 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_CONTEXT_MENU_H_ |
| OLD | NEW |