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

Side by Side Diff: chrome/browser/cocoa/bookmark_manager_controller.h

Issue 501073: Native Cocoa bookmark manager, part 1 (Closed)
Patch Set: Style fixes, and copy/paste unit tests Created 10 years, 11 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) 2009 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 #import <Cocoa/Cocoa.h>
6 #include "base/scoped_nsobject.h"
7
8 @class BookmarkGroupsController;
9 @class BookmarkTreeController;
10 class BookmarkManagerBridge;
11 class BookmarkModel;
12 class BookmarkNode;
13 class Profile;
14
15 // Controller for the bookmark manager window. There is at most one instance.
16 @interface BookmarkManagerController : NSWindowController {
17 @private
18 IBOutlet NSTableView* groupsTable_;
19 IBOutlet NSSearchField* toolbarSearchView_;
20 IBOutlet BookmarkGroupsController* groupsController_;
21 IBOutlet BookmarkTreeController* treeController_;
22
23 Profile* profile_; // weak
24 BookmarkManagerBridge* bridge_;
25 scoped_nsobject<NSMapTable> nodeMap_;
26 scoped_nsobject<NSImage> folderIcon_;
27 scoped_nsobject<NSImage> defaultFavIcon_;
28 }
29
30 // Opens the bookmark manager window, or brings it to the front if it's open.
31 + (BookmarkManagerController*)showBookmarkManager:(Profile*)profile;
32
33 // The BookmarkModel of the manager's Profile.
34 @property (readonly) BookmarkModel* bookmarkModel;
35
36 // Maps C++ BookmarkNode objects to opaque Objective-C objects.
37 // This allows nodes to be stored in NSArrays or NSOutlineViews.
38 - (id)itemFromNode:(const BookmarkNode*)node;
39
40 // Converse of -nodeFromItem: -- maps an opaque item back to a BookmarkNode.
41 - (const BookmarkNode*)nodeFromItem:(id)item;
42
43 // Returns the icon to be displayed for an item representing a BookmarkNode.
44 // This will be the URL's favicon, a generic page icon, or a folder icon.
45 - (NSImage*)iconForItem:(id)item;
46
47 // Opens a URL bookmark in a browser tab.
48 - (void)openBookmarkItem:(id)item;
49
50 // Called by the toolbar search field after the user changes its text.
51 - (IBAction)searchFieldChanged:(id)sender;
52
53 @end
54
55
56 // Exposed only for unit tests.
57 @interface BookmarkManagerController (UnitTesting)
58
59 - (void)forgetNode:(const BookmarkNode*)node;
60 @property (readonly) BookmarkGroupsController* groupsController;
61 @property (readonly) BookmarkTreeController* treeController;
62
63 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698