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 <map> | 9 #include <map> |
10 | 10 |
11 #import "base/mac/cocoa_protocols.h" | 11 #import "base/mac/cocoa_protocols.h" |
12 #include "base/mac/scoped_nsobject.h" | 12 #include "base/mac/scoped_nsobject.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h" | 14 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_bridge.h" |
15 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" | 15 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" |
16 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_state.h" | 16 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_state.h" |
17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h" | 17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_toolbar_view.h" |
18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" | 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" |
19 #import "chrome/browser/ui/cocoa/has_weak_browser_pointer.h" | 19 #import "chrome/browser/ui/cocoa/has_weak_browser_pointer.h" |
20 #include "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h" | 20 #include "chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h" |
21 #include "ui/base/window_open_disposition.h" | 21 #include "ui/base/window_open_disposition.h" |
22 | 22 |
23 @class BookmarkBarController; | 23 @class BookmarkBarController; |
24 @class BookmarkBarFolderController; | 24 @class BookmarkBarFolderController; |
25 @class BookmarkBarView; | 25 @class BookmarkBarView; |
26 @class BookmarkButtonCell; | 26 @class BookmarkButtonCell; |
27 @class BookmarkFolderTarget; | 27 @class BookmarkFolderTarget; |
28 @class BookmarkContextMenuCocoaController; | 28 @class BookmarkContextMenuCocoaController; |
29 class Browser; | 29 class Browser; |
30 class ChromeBookmarkClient; | |
31 class GURL; | 30 class GURL; |
32 namespace ui { | 31 namespace ui { |
33 class ThemeProvider; | 32 class ThemeProvider; |
34 } | 33 } |
35 | 34 |
36 namespace bookmarks { | 35 namespace bookmarks { |
37 | 36 |
38 class BookmarkModel; | 37 class BookmarkModel; |
39 class BookmarkNode; | 38 class BookmarkNode; |
| 39 class ManagedBookmarkService; |
40 | 40 |
41 // Magic numbers from Cole | 41 // Magic numbers from Cole |
42 // TODO(jrg): create an objc-friendly version of bookmark_bar_constants.h? | 42 // TODO(jrg): create an objc-friendly version of bookmark_bar_constants.h? |
43 | 43 |
44 // Used as a maximum width for buttons on the bar. | 44 // Used as a maximum width for buttons on the bar. |
45 const CGFloat kDefaultBookmarkWidth = 150.0; | 45 const CGFloat kDefaultBookmarkWidth = 150.0; |
46 | 46 |
47 // Horizontal frame inset for buttons in the bookmark bar. | 47 // Horizontal frame inset for buttons in the bookmark bar. |
48 const CGFloat kBookmarkHorizontalPadding = 1.0; | 48 const CGFloat kBookmarkHorizontalPadding = 1.0; |
49 | 49 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 // The "original" state of the bookmark bar if an animation is running. | 169 // The "original" state of the bookmark bar if an animation is running. |
170 BookmarkBar::State lastState_; | 170 BookmarkBar::State lastState_; |
171 | 171 |
172 // YES if an animation is running. | 172 // YES if an animation is running. |
173 BOOL isAnimationRunning_; | 173 BOOL isAnimationRunning_; |
174 | 174 |
175 Browser* browser_; // weak; owned by its window | 175 Browser* browser_; // weak; owned by its window |
176 bookmarks::BookmarkModel* bookmarkModel_; // weak; part of the profile owned | 176 bookmarks::BookmarkModel* bookmarkModel_; // weak; part of the profile owned |
177 // by the top-level Browser object. | 177 // by the top-level Browser object. |
178 ChromeBookmarkClient* bookmarkClient_; | 178 bookmarks::ManagedBookmarkService* managedBookmarkService_; |
179 | 179 |
180 // Our initial view width, which is applied in awakeFromNib. | 180 // Our initial view width, which is applied in awakeFromNib. |
181 CGFloat initialWidth_; | 181 CGFloat initialWidth_; |
182 | 182 |
183 // BookmarkNodes have a 64bit id. NSMenuItems have a 32bit tag used | 183 // BookmarkNodes have a 64bit id. NSMenuItems have a 32bit tag used |
184 // to represent the bookmark node they refer to. This map provides | 184 // to represent the bookmark node they refer to. This map provides |
185 // a mapping from one to the other, so we can properly identify the | 185 // a mapping from one to the other, so we can properly identify the |
186 // node from the item. When adding items in, we start with seedId_. | 186 // node from the item. When adding items in, we start with seedId_. |
187 int32 seedId_; | 187 int32 seedId_; |
188 std::map<int32,int64> menuTagMap_; | 188 std::map<int32,int64> menuTagMap_; |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 - (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point; | 424 - (BookmarkButton*)buttonForDroppingOnAtPoint:(NSPoint)point; |
425 - (BOOL)isEventAnExitEvent:(NSEvent*)event; | 425 - (BOOL)isEventAnExitEvent:(NSEvent*)event; |
426 - (BOOL)shrinkOrHideView:(NSView*)view forMaxX:(CGFloat)maxViewX; | 426 - (BOOL)shrinkOrHideView:(NSView*)view forMaxX:(CGFloat)maxViewX; |
427 - (void)unhighlightBookmark:(const bookmarks::BookmarkNode*)node; | 427 - (void)unhighlightBookmark:(const bookmarks::BookmarkNode*)node; |
428 | 428 |
429 // The following are for testing purposes only and are not used internally. | 429 // The following are for testing purposes only and are not used internally. |
430 - (NSMenu *)menuForFolderNode:(const bookmarks::BookmarkNode*)node; | 430 - (NSMenu *)menuForFolderNode:(const bookmarks::BookmarkNode*)node; |
431 @end | 431 @end |
432 | 432 |
433 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_ | 433 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_CONTROLLER_H_ |
OLD | NEW |