Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(212)

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h

Issue 7720012: Moves ownership of MenuItemView to MenuRunner as well as responbility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_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 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // Creates an entry in menu for each child node of |parent| starting at 134 // Creates an entry in menu for each child node of |parent| starting at
135 // |start_child_index|. 135 // |start_child_index|.
136 void BuildMenu(const BookmarkNode* parent, 136 void BuildMenu(const BookmarkNode* parent,
137 int start_child_index, 137 int start_child_index,
138 views::MenuItemView* menu, 138 views::MenuItemView* menu,
139 int* next_menu_id); 139 int* next_menu_id);
140 140
141 // Returns the menu whose id is |id|. 141 // Returns the menu whose id is |id|.
142 views::MenuItemView* GetMenuByID(int id); 142 views::MenuItemView* GetMenuByID(int id);
143 143
144 // Does the work of processing WillRemoveBookmarks. On exit the set of removed
145 // menus is added to |removed_menus|. It's up to the caller to delete the
146 // the menus added to |removed_menus|.
147 void WillRemoveBookmarksImpl(
148 const std::vector<const BookmarkNode*>& bookmarks,
149 std::set<views::MenuItemView*>* removed_menus);
150
151 Profile* profile_; 144 Profile* profile_;
152 145
153 PageNavigator* page_navigator_; 146 PageNavigator* page_navigator_;
154 147
155 // Parent of menus. 148 // Parent of menus.
156 views::Widget* parent_; 149 views::Widget* parent_;
157 150
158 // Maps from menu id to BookmarkNode. 151 // Maps from menu id to BookmarkNode.
159 std::map<int, const BookmarkNode*> menu_id_to_node_map_; 152 std::map<int, const BookmarkNode*> menu_id_to_node_map_;
160 153
(...skipping 24 matching lines...) Expand all
185 178
186 views::MenuDelegate* real_delegate_; 179 views::MenuDelegate* real_delegate_;
187 180
188 // Is the model being changed? 181 // Is the model being changed?
189 bool is_mutating_model_; 182 bool is_mutating_model_;
190 183
191 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuDelegate); 184 DISALLOW_COPY_AND_ASSIGN(BookmarkMenuDelegate);
192 }; 185 };
193 186
194 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_DELEGATE_H_ 187 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_MENU_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698