OLD | NEW |
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 <stdint.h> |
9 #include <map> | 10 #include <map> |
10 | 11 |
11 #import "base/mac/cocoa_protocols.h" | 12 #import "base/mac/cocoa_protocols.h" |
12 #include "base/mac/scoped_nsobject.h" | 13 #include "base/mac/scoped_nsobject.h" |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h" | 15 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h" |
15 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" | 16 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" |
16 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_state.h" | 17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_state.h" |
17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h" | 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h" |
18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" | 19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // by the top-level Browser object. | 179 // by the top-level Browser object. |
179 bookmarks::ManagedBookmarkService* managedBookmarkService_; | 180 bookmarks::ManagedBookmarkService* managedBookmarkService_; |
180 | 181 |
181 // Our initial view width, which is applied in awakeFromNib. | 182 // Our initial view width, which is applied in awakeFromNib. |
182 CGFloat initialWidth_; | 183 CGFloat initialWidth_; |
183 | 184 |
184 // BookmarkNodes have a 64bit id. NSMenuItems have a 32bit tag used | 185 // BookmarkNodes have a 64bit id. NSMenuItems have a 32bit tag used |
185 // to represent the bookmark node they refer to. This map provides | 186 // to represent the bookmark node they refer to. This map provides |
186 // a mapping from one to the other, so we can properly identify the | 187 // a mapping from one to the other, so we can properly identify the |
187 // node from the item. When adding items in, we start with seedId_. | 188 // node from the item. When adding items in, we start with seedId_. |
188 int32 seedId_; | 189 int32_t seedId_; |
189 std::map<int32,int64> menuTagMap_; | 190 std::map<int32_t, int64_t> menuTagMap_; |
190 | 191 |
191 // Our bookmark buttons, ordered from L-->R. | 192 // Our bookmark buttons, ordered from L-->R. |
192 base::scoped_nsobject<NSMutableArray> buttons_; | 193 base::scoped_nsobject<NSMutableArray> buttons_; |
193 | 194 |
194 // The folder image so we can use one copy for all buttons | 195 // The folder image so we can use one copy for all buttons |
195 base::scoped_nsobject<NSImage> folderImage_; | 196 base::scoped_nsobject<NSImage> folderImage_; |
196 | 197 |
197 // The default image, so we can use one copy for all buttons. | 198 // The default image, so we can use one copy for all buttons. |
198 base::scoped_nsobject<NSImage> defaultImage_; | 199 base::scoped_nsobject<NSImage> defaultImage_; |
199 | 200 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 - (id)folderTarget; | 428 - (id)folderTarget; |
428 - (int)displayedButtonCount; | 429 - (int)displayedButtonCount; |
429 - (void)openURL:(GURL)url disposition:(WindowOpenDisposition)disposition; | 430 - (void)openURL:(GURL)url disposition:(WindowOpenDisposition)disposition; |
430 - (void)clearBookmarkBar; | 431 - (void)clearBookmarkBar; |
431 - (BookmarkButtonCell*)cellForBookmarkNode:(const bookmarks::BookmarkNode*)node; | 432 - (BookmarkButtonCell*)cellForBookmarkNode:(const bookmarks::BookmarkNode*)node; |
432 - (BookmarkButtonCell*)cellForCustomButtonWithText:(NSString*)text | 433 - (BookmarkButtonCell*)cellForCustomButtonWithText:(NSString*)text |
433 image:(NSImage*)image; | 434 image:(NSImage*)image; |
434 - (NSRect)frameForBookmarkButtonFromCell:(NSCell*)cell xOffset:(int*)xOffset; | 435 - (NSRect)frameForBookmarkButtonFromCell:(NSCell*)cell xOffset:(int*)xOffset; |
435 - (void)checkForBookmarkButtonGrowth:(NSButton*)button; | 436 - (void)checkForBookmarkButtonGrowth:(NSButton*)button; |
436 - (void)frameDidChange; | 437 - (void)frameDidChange; |
437 - (int64)nodeIdFromMenuTag:(int32)tag; | 438 - (int64_t)nodeIdFromMenuTag:(int32_t)tag; |
438 - (int32)menuTagFromNodeId:(int64)menuid; | 439 - (int32_t)menuTagFromNodeId:(int64_t)menuid; |
439 - (void)updateTheme:(const ui::ThemeProvider*)themeProvider; | 440 - (void)updateTheme:(const ui::ThemeProvider*)themeProvider; |
440 - (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point; | 441 - (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point; |
441 - (BOOL)isEventAnExitEvent:(NSEvent*)event; | 442 - (BOOL)isEventAnExitEvent:(NSEvent*)event; |
442 - (BOOL)shrinkOrHideView:(NSView*)view forMaxX:(CGFloat)maxViewX; | 443 - (BOOL)shrinkOrHideView:(NSView*)view forMaxX:(CGFloat)maxViewX; |
443 - (void)unhighlightBookmark:(const bookmarks::BookmarkNode*)node; | 444 - (void)unhighlightBookmark:(const bookmarks::BookmarkNode*)node; |
444 | 445 |
445 // The following are for testing purposes only and are not used internally. | 446 // The following are for testing purposes only and are not used internally. |
446 - (NSMenu *)menuForFolderNode:(const bookmarks::BookmarkNode*)node; | 447 - (NSMenu *)menuForFolderNode:(const bookmarks::BookmarkNode*)node; |
447 @end | 448 @end |
448 | 449 |
449 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_ | 450 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_ |
OLD | NEW |