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

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

Issue 12550006: Mac: Add a shortcut to open the Apps page from the bookmark bar. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No longer touching model or views. Created 7 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <map> 9 #include <map>
10 10
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 IBOutlet BookmarkBarView* buttonView_; // Contains 'no items' text fields. 219 IBOutlet BookmarkBarView* buttonView_; // Contains 'no items' text fields.
220 IBOutlet BookmarkButton* offTheSideButton_; // aka the chevron. 220 IBOutlet BookmarkButton* offTheSideButton_; // aka the chevron.
221 IBOutlet NSMenu* buttonContextMenu_; 221 IBOutlet NSMenu* buttonContextMenu_;
222 222
223 NSRect originalNoItemsRect_; // Original, pre-resized field rect. 223 NSRect originalNoItemsRect_; // Original, pre-resized field rect.
224 NSRect originalImportBookmarksRect_; // Original, pre-resized field rect. 224 NSRect originalImportBookmarksRect_; // Original, pre-resized field rect.
225 225
226 // "Other bookmarks" button on the right side. 226 // "Other bookmarks" button on the right side.
227 scoped_nsobject<BookmarkButton> otherBookmarksButton_; 227 scoped_nsobject<BookmarkButton> otherBookmarksButton_;
228 228
229 // "Apps" button to the right of "Other bookmarks".
230 scoped_nsobject<BookmarkButton> appsPageShortcutButton_;
231
229 // We have a special menu for folder buttons. This starts as a copy 232 // We have a special menu for folder buttons. This starts as a copy
230 // of the bar menu. 233 // of the bar menu.
231 scoped_nsobject<BookmarkMenu> buttonFolderContextMenu_; 234 scoped_nsobject<BookmarkMenu> buttonFolderContextMenu_;
232 235
233 // When doing a drag, this is folder button "hovered over" which we 236 // When doing a drag, this is folder button "hovered over" which we
234 // may want to open after a short delay. There are cases where a 237 // may want to open after a short delay. There are cases where a
235 // mouse-enter can open a folder (e.g. if the menus are "active") 238 // mouse-enter can open a folder (e.g. if the menus are "active")
236 // but that doesn't use this variable or need a delay so "hover" is 239 // but that doesn't use this variable or need a delay so "hover" is
237 // the wrong term. 240 // the wrong term.
238 scoped_nsobject<BookmarkButton> hoverButton_; 241 scoped_nsobject<BookmarkButton> hoverButton_;
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 resizeDelegate:(id<ViewResizer>)resizeDelegate; 292 resizeDelegate:(id<ViewResizer>)resizeDelegate;
290 293
291 // Updates the bookmark bar (from its current, possibly in-transition) state to 294 // Updates the bookmark bar (from its current, possibly in-transition) state to
292 // the new state. 295 // the new state.
293 - (void)updateState:(BookmarkBar::State)newState 296 - (void)updateState:(BookmarkBar::State)newState
294 changeType:(BookmarkBar::AnimateChangeType)changeType; 297 changeType:(BookmarkBar::AnimateChangeType)changeType;
295 298
296 // Update the visible state of the bookmark bar. 299 // Update the visible state of the bookmark bar.
297 - (void)updateVisibility; 300 - (void)updateVisibility;
298 301
302 // Update the visible state of the bookmark bar.
303 - (void)updateAppsPageShortcutButtonVisibility;
304
299 // Hides or shows the bookmark bar depending on the current state. 305 // Hides or shows the bookmark bar depending on the current state.
300 - (void)updateHiddenState; 306 - (void)updateHiddenState;
301 307
302 // Turn on or off the bookmark bar and prevent or reallow its appearance. On 308 // Turn on or off the bookmark bar and prevent or reallow its appearance. On
303 // disable, toggle off if shown. On enable, show only if needed. App and popup 309 // disable, toggle off if shown. On enable, show only if needed. App and popup
304 // windows do not show a bookmark bar. 310 // windows do not show a bookmark bar.
305 - (void)setBookmarkBarEnabled:(BOOL)enabled; 311 - (void)setBookmarkBarEnabled:(BOOL)enabled;
306 312
307 // Returns the amount by which the toolbar above should be compressed. 313 // Returns the amount by which the toolbar above should be compressed.
308 - (CGFloat)getDesiredToolbarHeightCompression; 314 - (CGFloat)getDesiredToolbarHeightCompression;
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 - (NSMutableArray*)buttons; 398 - (NSMutableArray*)buttons;
393 - (NSButton*)offTheSideButton; 399 - (NSButton*)offTheSideButton;
394 - (BOOL)offTheSideButtonIsHidden; 400 - (BOOL)offTheSideButtonIsHidden;
395 - (BookmarkButton*)otherBookmarksButton; 401 - (BookmarkButton*)otherBookmarksButton;
396 - (BookmarkBarFolderController*)folderController; 402 - (BookmarkBarFolderController*)folderController;
397 - (id)folderTarget; 403 - (id)folderTarget;
398 - (int)displayedButtonCount; 404 - (int)displayedButtonCount;
399 - (void)openURL:(GURL)url disposition:(WindowOpenDisposition)disposition; 405 - (void)openURL:(GURL)url disposition:(WindowOpenDisposition)disposition;
400 - (void)clearBookmarkBar; 406 - (void)clearBookmarkBar;
401 - (BookmarkButtonCell*)cellForBookmarkNode:(const BookmarkNode*)node; 407 - (BookmarkButtonCell*)cellForBookmarkNode:(const BookmarkNode*)node;
408 - (BookmarkButtonCell*)cellForCustomButton:(NSString*)text
409 withImage:(NSImage*)image;
402 - (NSRect)frameForBookmarkButtonFromCell:(NSCell*)cell xOffset:(int*)xOffset; 410 - (NSRect)frameForBookmarkButtonFromCell:(NSCell*)cell xOffset:(int*)xOffset;
403 - (void)checkForBookmarkButtonGrowth:(NSButton*)button; 411 - (void)checkForBookmarkButtonGrowth:(NSButton*)button;
404 - (void)frameDidChange; 412 - (void)frameDidChange;
405 - (int64)nodeIdFromMenuTag:(int32)tag; 413 - (int64)nodeIdFromMenuTag:(int32)tag;
406 - (int32)menuTagFromNodeId:(int64)menuid; 414 - (int32)menuTagFromNodeId:(int64)menuid;
407 - (const BookmarkNode*)nodeFromMenuItem:(id)sender; 415 - (const BookmarkNode*)nodeFromMenuItem:(id)sender;
408 - (void)updateTheme:(ui::ThemeProvider*)themeProvider; 416 - (void)updateTheme:(ui::ThemeProvider*)themeProvider;
409 - (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point; 417 - (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point;
410 - (BOOL)isEventAnExitEvent:(NSEvent*)event; 418 - (BOOL)isEventAnExitEvent:(NSEvent*)event;
411 - (BOOL)shrinkOrHideView:(NSView*)view forMaxX:(CGFloat)maxViewX; 419 - (BOOL)shrinkOrHideView:(NSView*)view forMaxX:(CGFloat)maxViewX;
412 - (void)unhighlightBookmark:(const BookmarkNode*)node; 420 - (void)unhighlightBookmark:(const BookmarkNode*)node;
413 421
414 // The following are for testing purposes only and are not used internally. 422 // The following are for testing purposes only and are not used internally.
415 - (NSMenu *)menuForFolderNode:(const BookmarkNode*)node; 423 - (NSMenu *)menuForFolderNode:(const BookmarkNode*)node;
416 - (NSMenu*)buttonContextMenu; 424 - (NSMenu*)buttonContextMenu;
417 - (void)setButtonContextMenu:(id)menu; 425 - (void)setButtonContextMenu:(id)menu;
418 @end 426 @end
419 427
420 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_ 428 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698