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

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

Issue 9814031: views/bookmarks: Convert BookmarkEditorView from Menu2 API to MenuModelApdater/MenuRunner API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win Created 8 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_EDITOR_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_EDITOR_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_EDITOR_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_EDITOR_VIEW_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/string16.h" 13 #include "base/string16.h"
14 #include "chrome/browser/bookmarks/bookmark_editor.h" 14 #include "chrome/browser/bookmarks/bookmark_editor.h"
15 #include "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h" 15 #include "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h"
16 #include "chrome/browser/bookmarks/bookmark_model_observer.h" 16 #include "chrome/browser/bookmarks/bookmark_model_observer.h"
17 #include "ui/base/models/simple_menu_model.h" 17 #include "ui/base/models/simple_menu_model.h"
18 #include "ui/base/models/tree_node_model.h" 18 #include "ui/base/models/tree_node_model.h"
19 #include "ui/views/context_menu_controller.h" 19 #include "ui/views/context_menu_controller.h"
20 #include "ui/views/controls/button/button.h" 20 #include "ui/views/controls/button/button.h"
21 #include "ui/views/controls/textfield/textfield.h" 21 #include "ui/views/controls/textfield/textfield.h"
22 #include "ui/views/controls/textfield/textfield_controller.h" 22 #include "ui/views/controls/textfield/textfield_controller.h"
23 #include "ui/views/controls/tree/tree_view_controller.h" 23 #include "ui/views/controls/tree/tree_view_controller.h"
24 #include "ui/views/window/dialog_delegate.h" 24 #include "ui/views/window/dialog_delegate.h"
25 25
26 namespace views { 26 namespace views {
27 class Label; 27 class Label;
28 class Menu2; 28 class MenuRunner;
29 class TextButton; 29 class TextButton;
30 class TreeView; 30 class TreeView;
31 } 31 }
32 32
33 class BookmarkEditorViewTest; 33 class BookmarkEditorViewTest;
34 class GURL; 34 class GURL;
35 class Menu; 35 class Menu;
36 class Profile; 36 class Profile;
37 37
38 // View that allows the user to edit a bookmark/starred URL. The user can 38 // View that allows the user to edit a bookmark/starred URL. The user can
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // Creates a new EditorNode as the last child of parent. The new node is 217 // Creates a new EditorNode as the last child of parent. The new node is
218 // added to the model and returned. This does NOT start editing. This is used 218 // added to the model and returned. This does NOT start editing. This is used
219 // internally by NewFolder and broken into a separate method for testing. 219 // internally by NewFolder and broken into a separate method for testing.
220 EditorNode* AddNewFolder(EditorNode* parent); 220 EditorNode* AddNewFolder(EditorNode* parent);
221 221
222 // If |editor_node| is expanded it's added to |expanded_nodes| and this is 222 // If |editor_node| is expanded it's added to |expanded_nodes| and this is
223 // recursively invoked for all the children. 223 // recursively invoked for all the children.
224 void UpdateExpandedNodes(EditorNode* editor_node, 224 void UpdateExpandedNodes(EditorNode* editor_node,
225 BookmarkExpandedStateTracker::Nodes* expanded_nodes); 225 BookmarkExpandedStateTracker::Nodes* expanded_nodes);
226 226
227 ui::SimpleMenuModel* GetMenuModel();
228
227 // Profile the entry is from. 229 // Profile the entry is from.
228 Profile* profile_; 230 Profile* profile_;
229 231
230 // Model driving the TreeView. 232 // Model driving the TreeView.
231 scoped_ptr<EditorTreeModel> tree_model_; 233 scoped_ptr<EditorTreeModel> tree_model_;
232 234
233 // Displays star folder. 235 // Displays star folder.
234 views::TreeView* tree_view_; 236 views::TreeView* tree_view_;
235 237
236 // Used to create a new folder. 238 // Used to create a new folder.
(...skipping 11 matching lines...) Expand all
248 // Used for editing the title. 250 // Used for editing the title.
249 views::Textfield title_tf_; 251 views::Textfield title_tf_;
250 252
251 // Initial parent to select. Is only used if |details_.existing_node| is 253 // Initial parent to select. Is only used if |details_.existing_node| is
252 // NULL. 254 // NULL.
253 const BookmarkNode* parent_; 255 const BookmarkNode* parent_;
254 256
255 const EditDetails details_; 257 const EditDetails details_;
256 258
257 // The context menu. 259 // The context menu.
258 scoped_ptr<ui::SimpleMenuModel> context_menu_contents_; 260 scoped_ptr<ui::SimpleMenuModel> context_menu_model_;
259 #if !defined(USE_AURA) 261 scoped_ptr<views::MenuRunner> context_menu_runner_;
260 scoped_ptr<views::Menu2> context_menu_;
261 #endif
262 262
263 // Mode used to create nodes from. 263 // Mode used to create nodes from.
264 BookmarkModel* bb_model_; 264 BookmarkModel* bb_model_;
265 265
266 // If true, we're running the menu for the bookmark bar or other bookmarks 266 // If true, we're running the menu for the bookmark bar or other bookmarks
267 // nodes. 267 // nodes.
268 bool running_menu_for_root_; 268 bool running_menu_for_root_;
269 269
270 // Is the tree shown? 270 // Is the tree shown?
271 bool show_tree_; 271 bool show_tree_;
272 272
273 // List of deleted bookmark folders. 273 // List of deleted bookmark folders.
274 std::vector<int64> deletes_; 274 std::vector<int64> deletes_;
275 275
276 DISALLOW_COPY_AND_ASSIGN(BookmarkEditorView); 276 DISALLOW_COPY_AND_ASSIGN(BookmarkEditorView);
277 }; 277 };
278 278
279 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_EDITOR_VIEW_H_ 279 #endif // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_EDITOR_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698