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

Side by Side Diff: chrome/browser/bookmarks/recently_used_folders_combo_model.h

Issue 14581004: bookmarks: Move recently_used_folders_combo_model* into c/b/ui/bookmarks/ directory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/bookmarks/recently_used_folders_combo_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_BOOKMARKS_RECENTLY_USED_FOLDERS_COMBO_MODEL_H_
6 #define CHROME_BROWSER_BOOKMARKS_RECENTLY_USED_FOLDERS_COMBO_MODEL_H_
7
8 #include <vector>
9
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "ui/base/models/combobox_model.h"
13
14 class BookmarkModel;
15 class BookmarkNode;
16
17 // Model for the combobox showing the list of folders to choose from. The
18 // list always contains the Bookmarks Bar, Other Bookmarks and the parent
19 // folder. The list also contains an extra item that shows the text
20 // "Choose Another Folder...".
21 class RecentlyUsedFoldersComboModel : public ui::ComboboxModel {
22 public:
23 RecentlyUsedFoldersComboModel(BookmarkModel* model, const BookmarkNode* node);
24 virtual ~RecentlyUsedFoldersComboModel();
25
26 // Overridden from ui::ComboboxModel:
27 virtual int GetItemCount() const OVERRIDE;
28 virtual string16 GetItemAt(int index) OVERRIDE;
29 virtual bool IsItemSeparatorAt(int index) OVERRIDE;
30 virtual int GetDefaultIndex() const OVERRIDE;
31
32 // If necessary this function moves |node| into the corresponding folder for
33 // the given |selected_index|.
34 void MaybeChangeParent(const BookmarkNode* node, int selected_index);
35
36 private:
37 // Returns the node at the specified |index|.
38 const BookmarkNode* GetNodeAt(int index);
39
40 // Removes |node| from |items_|. Does nothing if |node| is not in |items_|.
41 void RemoveNode(const BookmarkNode* node);
42
43 struct Item;
44 std::vector<Item> items_;
45
46 BookmarkModel* bookmark_model_;
47
48 // The index of the original parent folder.
49 int node_parent_index_;
50
51 DISALLOW_COPY_AND_ASSIGN(RecentlyUsedFoldersComboModel);
52 };
53
54 #endif // CHROME_BROWSER_BOOKMARKS_RECENTLY_USED_FOLDERS_COMBO_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/bookmarks/recently_used_folders_combo_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698