OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 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_COCOA_BOOKMARK_BAR_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_BOOKMARK_BAR_CONTROLLER_H_ |
6 #define CHROME_BROWSER_COCOA_BOOKMARK_BAR_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_BOOKMARK_BAR_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/scoped_nsobject.h" | 10 #include "base/scoped_nsobject.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 @protocol BookmarkURLOpener | 22 @protocol BookmarkURLOpener |
23 - (void)openBookmarkURL:(const GURL&)url | 23 - (void)openBookmarkURL:(const GURL&)url |
24 disposition:(WindowOpenDisposition)disposition; | 24 disposition:(WindowOpenDisposition)disposition; |
25 @end | 25 @end |
26 | 26 |
27 | 27 |
28 // A controller for the bookmark bar in the browser window. Handles showing | 28 // A controller for the bookmark bar in the browser window. Handles showing |
29 // and hiding based on the preference in the given profile. | 29 // and hiding based on the preference in the given profile. |
30 @interface BookmarkBarController : NSViewController { | 30 @interface BookmarkBarController : NSViewController { |
31 @private | 31 @private |
| 32 Profile* profile_; // weak |
32 BookmarkModel* bookmarkModel_; // weak; part of the profile owned by the | 33 BookmarkModel* bookmarkModel_; // weak; part of the profile owned by the |
33 // top-level Browser object. | 34 // top-level Browser object. |
34 PrefService* preferences_; // (ditto) | |
35 | 35 |
36 // Currently these two are always the same when not in fullscreen | 36 // Currently these two are always the same when not in fullscreen |
37 // mode, but they mean slightly different things. | 37 // mode, but they mean slightly different things. |
38 // contentAreaHasOffset_ is an implementation detail of bookmark bar | 38 // contentAreaHasOffset_ is an implementation detail of bookmark bar |
39 // show state. | 39 // show state. |
40 BOOL contentViewHasOffset_; | 40 BOOL contentViewHasOffset_; |
41 BOOL barShouldBeShown_; | 41 BOOL barShouldBeShown_; |
42 | 42 |
43 // Our bookmark buttons, ordered from L-->R. | 43 // Our bookmark buttons, ordered from L-->R. |
44 scoped_nsobject<NSMutableArray> buttons_; | 44 scoped_nsobject<NSMutableArray> buttons_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 - (BOOL)isBookmarkBarVisible; | 76 - (BOOL)isBookmarkBarVisible; |
77 | 77 |
78 // Toggle the state of the bookmark bar. | 78 // Toggle the state of the bookmark bar. |
79 - (void)toggleBookmarkBar; | 79 - (void)toggleBookmarkBar; |
80 | 80 |
81 // Turn on or off the bookmark bar and prevent or reallow its | 81 // Turn on or off the bookmark bar and prevent or reallow its |
82 // appearance. On disable, toggle off if shown. On enable, show only | 82 // appearance. On disable, toggle off if shown. On enable, show only |
83 // if needed. For fullscreen mode. | 83 // if needed. For fullscreen mode. |
84 - (void)setBookmarkBarEnabled:(BOOL)enabled; | 84 - (void)setBookmarkBarEnabled:(BOOL)enabled; |
85 | 85 |
86 // Actions for opening bookmarks. From a button, ... | 86 // Actions for manipulating bookmarks. |
| 87 // From a button, ... |
87 - (IBAction)openBookmark:(id)sender; | 88 - (IBAction)openBookmark:(id)sender; |
88 // ... or from a context menu over the button. | 89 // From a context menu over the button, ... |
89 - (IBAction)openBookmarkInNewForegroundTab:(id)sender; | 90 - (IBAction)openBookmarkInNewForegroundTab:(id)sender; |
90 - (IBAction)openBookmarkInNewWindow:(id)sender; | 91 - (IBAction)openBookmarkInNewWindow:(id)sender; |
91 - (IBAction)openBookmarkInIncognitoWindow:(id)sender; | 92 - (IBAction)openBookmarkInIncognitoWindow:(id)sender; |
| 93 - (IBAction)editBookmark:(id)sender; |
92 - (IBAction)deleteBookmark:(id)sender; | 94 - (IBAction)deleteBookmark:(id)sender; |
| 95 // From a context menu over the bar, ... |
| 96 - (IBAction)openAllBookmarks:(id)sender; |
| 97 // Or from a context menu over either the bar or a button. |
| 98 - (IBAction)addPage:(id)sender; |
| 99 |
93 | 100 |
94 @end | 101 @end |
95 | 102 |
96 // Redirects from BookmarkBarBridge, the C++ object which glues us to | 103 // Redirects from BookmarkBarBridge, the C++ object which glues us to |
97 // the rest of Chromium. Internal to BookmarkBarController. | 104 // the rest of Chromium. Internal to BookmarkBarController. |
98 @interface BookmarkBarController(BridgeRedirect) | 105 @interface BookmarkBarController(BridgeRedirect) |
99 - (void)loaded:(BookmarkModel*)model; | 106 - (void)loaded:(BookmarkModel*)model; |
100 - (void)beingDeleted:(BookmarkModel*)model; | 107 - (void)beingDeleted:(BookmarkModel*)model; |
101 - (void)nodeMoved:(BookmarkModel*)model | 108 - (void)nodeMoved:(BookmarkModel*)model |
102 oldParent:(const BookmarkNode*)oldParent oldIndex:(int)oldIndex | 109 oldParent:(const BookmarkNode*)oldParent oldIndex:(int)oldIndex |
(...skipping 15 matching lines...) Expand all Loading... |
118 @interface BookmarkBarController(TestingAPI) | 125 @interface BookmarkBarController(TestingAPI) |
119 // Set the delegate for a unit test. | 126 // Set the delegate for a unit test. |
120 - (void)setDelegate:(id<BookmarkURLOpener>)delegate; | 127 - (void)setDelegate:(id<BookmarkURLOpener>)delegate; |
121 - (void)clearBookmarkBar; | 128 - (void)clearBookmarkBar; |
122 - (NSArray*)buttons; | 129 - (NSArray*)buttons; |
123 - (NSRect)frameForBookmarkButtonFromCell:(NSCell*)cell xOffset:(int*)xOffset; | 130 - (NSRect)frameForBookmarkButtonFromCell:(NSCell*)cell xOffset:(int*)xOffset; |
124 - (void)checkForBookmarkButtonGrowth:(NSButton*)button; | 131 - (void)checkForBookmarkButtonGrowth:(NSButton*)button; |
125 @end | 132 @end |
126 | 133 |
127 #endif // CHROME_BROWSER_COCOA_BOOKMARK_BAR_CONTROLLER_H_ | 134 #endif // CHROME_BROWSER_COCOA_BOOKMARK_BAR_CONTROLLER_H_ |
OLD | NEW |