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

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

Issue 1730015: Windows/Views: delete native bookmark manager code. (Closed)
Patch Set: Patch with fixed file perms. Created 10 years, 8 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_BOOKMARKS_BOOKMARK_TABLE_MODEL_H_
6 #define CHROME_BROWSER_BOOKMARKS_BOOKMARK_TABLE_MODEL_H_
7
8 #include "app/table_model.h"
9 #include "build/build_config.h"
10 #include "chrome/browser/bookmarks/bookmark_model_observer.h"
11
12 // BookmarkTableModel provides a view of the BookmarkModel as a TableModel.
13 // Three variations are provided:
14 // . Recently created bookmarks.
15 // . The children of a particular folder.
16 // . All bookmarks matching the specified text.
17 class BookmarkTableModel : public TableModel,
18 public BookmarkModelObserver {
19 public:
20 // Methods for creating the various BookmarkTableModels. Ownership passes
21 // to the caller.
22 // |languages| is the kAcceptLanguages value of the user preference. It is
23 // used to decode IDN.
24 static BookmarkTableModel* CreateRecentlyBookmarkedModel(
25 BookmarkModel* model);
26 static BookmarkTableModel* CreateBookmarkTableModelForFolder(
27 BookmarkModel* model, const BookmarkNode* node);
28 static BookmarkTableModel* CreateSearchTableModel(
29 BookmarkModel* model,
30 const std::wstring& text,
31 const std::wstring& languages);
32
33 explicit BookmarkTableModel(BookmarkModel* model);
34 virtual ~BookmarkTableModel();
35
36 // TableModel methods.
37 virtual std::wstring GetText(int row, int column_id);
38 virtual SkBitmap GetIcon(int row);
39 virtual void SetObserver(TableModelObserver* observer) {
40 observer_ = observer;
41 }
42
43 // BookmarkModelObserver methods.
44 virtual void Loaded(BookmarkModel* model) {}
45 virtual void BookmarkModelBeingDeleted(BookmarkModel* model);
46 virtual void BookmarkNodeChildrenReordered(BookmarkModel* model,
47 const BookmarkNode* node) {}
48
49
50 // Returns the index of the specified node, or -1 if the node isn't in the
51 // model.
52 virtual int IndexOfNode(const BookmarkNode* node);
53
54 // Returns the BookmarkNode at the specified index.
55 virtual const BookmarkNode* GetNodeForRow(int row) = 0;
56
57 // Returns the underlying BookmarkModel.
58 BookmarkModel* model() const { return model_; }
59
60 protected:
61 TableModelObserver* observer() const { return observer_; }
62
63 private:
64 // Builds the path shown in the path column for the specified node.
65 void BuildPath(const BookmarkNode* node, std::wstring* path);
66
67 BookmarkModel* model_;
68 TableModelObserver* observer_;
69
70 DISALLOW_COPY_AND_ASSIGN(BookmarkTableModel);
71 };
72
73 #endif // CHROME_BROWSER_BOOKMARKS_BOOKMARK_TABLE_MODEL_H_
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_manager.h ('k') | chrome/browser/bookmarks/bookmark_table_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698