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

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

Issue 126294: Mac fullscreen mode (with pkasting). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | « chrome/app/nibs/en.lproj/MainMenu.xib ('k') | chrome/browser/cocoa/bookmark_bar_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "chrome/browser/cocoa/bookmark_bar_bridge.h" 11 #include "chrome/browser/cocoa/bookmark_bar_bridge.h"
12 #include "webkit/glue/window_open_disposition.h" 12 #include "webkit/glue/window_open_disposition.h"
13 13
14 @class BookmarkBarStateController; 14 @class BookmarkBarStateController;
15 class BookmarkModel; 15 class BookmarkModel;
16 class BookmarkNode; 16 class BookmarkNode;
17 @class BookmarkBarView; 17 @class BookmarkBarView;
18 class Profile; 18 class Profile;
19 class PrefService;
19 20
20 // The interface for an object which can open URLs for a bookmark. 21 // The interface for an object which can open URLs for a bookmark.
21 @protocol BookmarkURLOpener 22 @protocol BookmarkURLOpener
22 - (void)openBookmarkURL:(const GURL&)url 23 - (void)openBookmarkURL:(const GURL&)url
23 disposition:(WindowOpenDisposition)disposition; 24 disposition:(WindowOpenDisposition)disposition;
24 @end 25 @end
25 26
26 27
27 // 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
28 // and hiding based on the preference in the given profile. 29 // and hiding based on the preference in the given profile.
29 @interface BookmarkBarController : NSObject { 30 @interface BookmarkBarController : NSObject {
30 @private 31 @private
31 BookmarkModel* bookmarkModel_; // weak; part of the profile owned by the 32 BookmarkModel* bookmarkModel_; // weak; part of the profile owned by the
32 // top-level Browser object. 33 // top-level Browser object.
34 PrefService* preferences_; // (ditto)
33 35
34 // Currently these two are always the same, but they mean slightly 36 // Currently these two are always the same when not in fullscreen
35 // different things. contentAreaHasOffset_ is an implementation 37 // mode, but they mean slightly different things.
36 // detail of bookmark bar visibility. 38 // contentAreaHasOffset_ is an implementation detail of bookmark bar
39 // show state.
37 BOOL contentViewHasOffset_; 40 BOOL contentViewHasOffset_;
38 BOOL barIsVisible_; 41 BOOL barShouldBeShown_;
42
43 // If the bar is disabled, we hide it and ignore show/hide commands.
44 // Set when using fullscreen mode.
45 BOOL barIsEnabled_;
39 46
40 // The view of the bookmark bar itself. 47 // The view of the bookmark bar itself.
41 // Not made into a scoped_nsobject since I may move it into a nib. 48 // Not made into a scoped_nsobject since I may move it into a nib.
42 // (See TODO in initWithProfile: in bookmark_bar_controller.mm). 49 // (See TODO in initWithProfile: in bookmark_bar_controller.mm).
43 IBOutlet BookmarkBarView* bookmarkBarView_; 50 IBOutlet BookmarkBarView* bookmarkBarView_;
44 51
45 // The tab content area for the window (where the web goes) 52 // The tab content area for the window (where the web goes)
46 IBOutlet NSView* contentView_; 53 IBOutlet NSView* contentView_;
47 54
48 // Bridge from Chrome-style C++ notifications (e.g. derived from 55 // Bridge from Chrome-style C++ notifications (e.g. derived from
(...skipping 14 matching lines...) Expand all
63 70
64 // Resizes the bookmark bar based on the state of the content area. 71 // Resizes the bookmark bar based on the state of the content area.
65 - (void)resizeBookmarkBar; 72 - (void)resizeBookmarkBar;
66 73
67 // Returns whether or not the bookmark bar is visible. 74 // Returns whether or not the bookmark bar is visible.
68 - (BOOL)isBookmarkBarVisible; 75 - (BOOL)isBookmarkBarVisible;
69 76
70 // Toggle the state of the bookmark bar. 77 // Toggle the state of the bookmark bar.
71 - (void)toggleBookmarkBar; 78 - (void)toggleBookmarkBar;
72 79
80 // Turn on or off the bookmark bar and prevent or reallow its
81 // appearance. On disable, toggle off if shown. On enable, show only
82 // if needed. For fullscreen mode.
83 - (void)setBookmarkBarEnabled:(BOOL)enabled;
84
73 @end 85 @end
74 86
75 // Redirects from BookmarkBarBridge, the C++ object which glues us to 87 // Redirects from BookmarkBarBridge, the C++ object which glues us to
76 // the rest of Chromium. Internal to BookmarkBarController. 88 // the rest of Chromium. Internal to BookmarkBarController.
77 @interface BookmarkBarController(BridgeRedirect) 89 @interface BookmarkBarController(BridgeRedirect)
78 - (void)loaded:(BookmarkModel*)model; 90 - (void)loaded:(BookmarkModel*)model;
79 - (void)beingDeleted:(BookmarkModel*)model; 91 - (void)beingDeleted:(BookmarkModel*)model;
80 - (void)nodeMoved:(BookmarkModel*)model 92 - (void)nodeMoved:(BookmarkModel*)model
81 oldParent:(const BookmarkNode*)oldParent oldIndex:(int)oldIndex 93 oldParent:(const BookmarkNode*)oldParent oldIndex:(int)oldIndex
82 newParent:(const BookmarkNode*)newParent newIndex:(int)newIndex; 94 newParent:(const BookmarkNode*)newParent newIndex:(int)newIndex;
83 - (void)nodeAdded:(BookmarkModel*)model 95 - (void)nodeAdded:(BookmarkModel*)model
84 parent:(const BookmarkNode*)oldParent index:(int)index; 96 parent:(const BookmarkNode*)oldParent index:(int)index;
85 - (void)nodeChanged:(BookmarkModel*)model 97 - (void)nodeChanged:(BookmarkModel*)model
86 node:(const BookmarkNode*)node; 98 node:(const BookmarkNode*)node;
87 - (void)nodeFavIconLoaded:(BookmarkModel*)model 99 - (void)nodeFavIconLoaded:(BookmarkModel*)model
88 node:(const BookmarkNode*)node; 100 node:(const BookmarkNode*)node;
89 - (void)nodeChildrenReordered:(BookmarkModel*)model 101 - (void)nodeChildrenReordered:(BookmarkModel*)model
90 node:(const BookmarkNode*)node; 102 node:(const BookmarkNode*)node;
91 @end 103 @end
92 104
93 105
94 // These APIs should only be used by unit tests, in place of "friend" classes. 106 // These APIs should only be used by unit tests, in place of "friend" classes.
95 @interface BookmarkBarController(TestingAPI) 107 @interface BookmarkBarController(TestingAPI)
96 // Access to the bookmark bar's view represented by this controller. 108 // Access to the bookmark bar's view represented by this controller.
97 - (NSView*)view; 109 - (NSView*)view;
98 @end 110 @end
99 111
100 #endif // CHROME_BROWSER_COCOA_BOOKMARK_BAR_CONTROLLER_H_ 112 #endif // CHROME_BROWSER_COCOA_BOOKMARK_BAR_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/app/nibs/en.lproj/MainMenu.xib ('k') | chrome/browser/cocoa/bookmark_bar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698