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 28 matching lines...) Expand all Loading... |
39 // show state. | 39 // show state. |
40 BOOL contentViewHasOffset_; | 40 BOOL contentViewHasOffset_; |
41 BOOL barShouldBeShown_; | 41 BOOL barShouldBeShown_; |
42 | 42 |
43 // If the bar is disabled, we hide it and ignore show/hide commands. | 43 // If the bar is disabled, we hide it and ignore show/hide commands. |
44 // Set when using fullscreen mode. | 44 // Set when using fullscreen mode. |
45 BOOL barIsEnabled_; | 45 BOOL barIsEnabled_; |
46 | 46 |
47 NSView* parentView_; // weak; our parent view | 47 NSView* parentView_; // weak; our parent view |
48 NSView* webContentView_; // weak; where the web goes | 48 NSView* webContentView_; // weak; where the web goes |
| 49 NSView* infoBarsView_; // weak; where the infobars go |
49 | 50 |
50 // Bridge from Chrome-style C++ notifications (e.g. derived from | 51 // Bridge from Chrome-style C++ notifications (e.g. derived from |
51 // BookmarkModelObserver) | 52 // BookmarkModelObserver) |
52 scoped_ptr<BookmarkBarBridge> bridge_; | 53 scoped_ptr<BookmarkBarBridge> bridge_; |
53 | 54 |
54 // Delegate which can open URLs for us. | 55 // Delegate which can open URLs for us. |
55 id<BookmarkURLOpener> delegate_; // weak | 56 id<BookmarkURLOpener> delegate_; // weak |
56 | 57 |
57 IBOutlet NSMenu* buttonContextMenu_; | 58 IBOutlet NSMenu* buttonContextMenu_; |
58 } | 59 } |
59 | 60 |
60 // Initializes the bookmark bar controller with the given browser | 61 // Initializes the bookmark bar controller with the given browser |
61 // profile, parent view (the toolbar), web content view, and delegate. | 62 // profile, parent view (the toolbar), web content view, and delegate. |
62 // |delegate| is used for opening URLs. | 63 // |delegate| is used for opening URLs. |
| 64 // TODO(rohitrao, jrg): The bookmark bar shouldn't know about the |
| 65 // infoBarsView or the webContentView. |
63 - (id)initWithProfile:(Profile*)profile | 66 - (id)initWithProfile:(Profile*)profile |
64 parentView:(NSView*)parentView | 67 parentView:(NSView*)parentView |
65 webContentView:(NSView*)webContentView | 68 webContentView:(NSView*)webContentView |
| 69 infoBarsView:(NSView*)infoBarsView |
66 delegate:(id<BookmarkURLOpener>)delegate; | 70 delegate:(id<BookmarkURLOpener>)delegate; |
67 | 71 |
68 // Returns whether or not the bookmark bar is visible. | 72 // Returns whether or not the bookmark bar is visible. |
69 - (BOOL)isBookmarkBarVisible; | 73 - (BOOL)isBookmarkBarVisible; |
70 | 74 |
71 // Toggle the state of the bookmark bar. | 75 // Toggle the state of the bookmark bar. |
72 - (void)toggleBookmarkBar; | 76 - (void)toggleBookmarkBar; |
73 | 77 |
74 // Turn on or off the bookmark bar and prevent or reallow its | 78 // Turn on or off the bookmark bar and prevent or reallow its |
75 // appearance. On disable, toggle off if shown. On enable, show only | 79 // appearance. On disable, toggle off if shown. On enable, show only |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 @end | 111 @end |
108 | 112 |
109 | 113 |
110 // These APIs should only be used by unit tests (or used internally). | 114 // These APIs should only be used by unit tests (or used internally). |
111 @interface BookmarkBarController(TestingAPI) | 115 @interface BookmarkBarController(TestingAPI) |
112 // Set the delegate for a unit test. | 116 // Set the delegate for a unit test. |
113 - (void)setDelegate:(id<BookmarkURLOpener>)delegate; | 117 - (void)setDelegate:(id<BookmarkURLOpener>)delegate; |
114 @end | 118 @end |
115 | 119 |
116 #endif // CHROME_BROWSER_COCOA_BOOKMARK_BAR_CONTROLLER_H_ | 120 #endif // CHROME_BROWSER_COCOA_BOOKMARK_BAR_CONTROLLER_H_ |
OLD | NEW |