| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // A simple custom NSView for the bookmark bar used to prevent clicking and | 5 // A simple custom NSView for the bookmark bar used to prevent clicking and |
| 6 // dragging from moving the browser window. | 6 // dragging from moving the browser window. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_VIEW_COCOA_H_ | 8 #ifndef CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_VIEW_COCOA_H_ |
| 9 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_VIEW_COCOA_H_ | 9 #define CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_VIEW_COCOA_H_ |
| 10 | 10 |
| 11 #import <Cocoa/Cocoa.h> | 11 #import <Cocoa/Cocoa.h> |
| 12 | 12 |
| 13 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw
eaker.h" | 13 #include "base/mac/scoped_nsobject.h" |
| 14 | 14 |
| 15 @class BookmarkBarController; | 15 @class BookmarkBarController; |
| 16 | 16 |
| 17 @interface BookmarkBarView : NSView { | 17 @interface BookmarkBarView : NSView { |
| 18 @private | 18 @private |
| 19 BOOL dropIndicatorShown_; | 19 BOOL dropIndicatorShown_; |
| 20 CGFloat dropIndicatorPosition_; // x position | 20 CGFloat dropIndicatorPosition_; // x position |
| 21 | 21 |
| 22 IBOutlet BookmarkBarController* controller_; | 22 BookmarkBarController* controller_; |
| 23 IBOutlet NSTextField* noItemTextfield_; | 23 base::scoped_nsobject<NSTextField> noItemTextfield_; |
| 24 IBOutlet NSButton* importBookmarksButton_; | 24 base::scoped_nsobject<NSButton> importBookmarksButton_; |
| 25 GTMWidthBasedTweaker* noItemContainer_; | 25 base::scoped_nsobject<NSView> noItemContainer_; |
| 26 } | 26 } |
| 27 - (NSTextField*)noItemTextfield; | 27 - (NSTextField*)noItemTextfield; |
| 28 - (NSButton*)importBookmarksButton; | 28 - (NSButton*)importBookmarksButton; |
| 29 - (BookmarkBarController*)controller; | 29 - (NSView*)noItemContainer; |
| 30 | 30 |
| 31 @property(nonatomic, assign) IBOutlet GTMWidthBasedTweaker* noItemContainer; | 31 - (instancetype)initWithController:(BookmarkBarController*)controller |
| 32 frame:(NSRect)frame; |
| 33 - (void)registerForNotificationsAndDraggedTypes; |
| 34 |
| 35 // Exposed so the controller can nil itself out. |
| 36 @property(nonatomic, assign) BookmarkBarController* controller; |
| 32 @end | 37 @end |
| 33 | 38 |
| 34 @interface BookmarkBarView() // TestingOrInternalAPI | 39 @interface BookmarkBarView() // TestingOrInternalAPI |
| 35 @property(nonatomic, readonly) BOOL dropIndicatorShown; | 40 @property(nonatomic, readonly) BOOL dropIndicatorShown; |
| 36 @property(nonatomic, readonly) CGFloat dropIndicatorPosition; | 41 @property(nonatomic, readonly) CGFloat dropIndicatorPosition; |
| 37 - (void)setController:(id)controller; | |
| 38 @end | 42 @end |
| 39 | 43 |
| 40 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_VIEW_COCOA_H_ | 44 #endif // CHROME_BROWSER_UI_COCOA_BOOKMARKS_BOOKMARK_BAR_VIEW_COCOA_H_ |
| OLD | NEW |