| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 #include <vector> | 6 #include <vector> |
| 7 #import "chrome/browser/ui/cocoa/draggable_button.h" | 7 #import "chrome/browser/ui/cocoa/draggable_button.h" |
| 8 #import "chrome/browser/ui/cocoa/themed_window.h" | 8 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 9 #include "ui/base/window_open_disposition.h" | 9 #include "ui/base/window_open_disposition.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 // Protocol for a BookmarkButton's delegate, responsible for doing | 21 // Protocol for a BookmarkButton's delegate, responsible for doing |
| 22 // things on behalf of a bookmark button. | 22 // things on behalf of a bookmark button. |
| 23 @protocol BookmarkButtonDelegate | 23 @protocol BookmarkButtonDelegate |
| 24 | 24 |
| 25 // Returns a pasteboard item that has all bookmark information. | 25 // Returns a pasteboard item that has all bookmark information. |
| 26 - (NSPasteboardItem*)pasteboardItemForDragOfButton:(BookmarkButton*)button; | 26 - (NSPasteboardItem*)pasteboardItemForDragOfButton:(BookmarkButton*)button; |
| 27 | 27 |
| 28 // Bookmark buttons pass mouseEntered: and mouseExited: events to | 28 // Bookmark buttons pass mouseEntered: and mouseExited: events to |
| 29 // their delegate. This allows the delegate to decide (for example) | 29 // their delegate. This allows the delegate to decide (for example) |
| 30 // which one, if any, should perform a hover-open. | 30 // which one, if any, should perform a hover-open. |
| 31 - (void)mouseEnteredButton:(id)button event:(NSEvent*)event; | 31 // |
| 32 - (void)mouseExitedButton:(id)button event:(NSEvent*)event; | 32 // mouseEnteredButton:event: is optimized to act only if the mouse is actually |
| 33 // within the button's bounds at the time of the call (with a fast moving mouse, |
| 34 // -isMouseReallyInside might return NO). Passing nil for |event| disables this |
| 35 // optimization, useful for unit testing. |
| 36 - (void)mouseEnteredButton:(BookmarkButton*)button event:(NSEvent*)event; |
| 37 - (void)mouseExitedButton:(BookmarkButton*)button event:(NSEvent*)event; |
| 33 | 38 |
| 34 // Returns YES if a drag operation should lock the fullscreen overlay bar | 39 // Returns YES if a drag operation should lock the fullscreen overlay bar |
| 35 // visibility before starting. For example, dragging a bookmark button should | 40 // visibility before starting. For example, dragging a bookmark button should |
| 36 // not lock the overlay if the bookmark bar is currently showing in detached | 41 // not lock the overlay if the bookmark bar is currently showing in detached |
| 37 // mode on the NTP. | 42 // mode on the NTP. |
| 38 - (BOOL)dragShouldLockBarVisibility; | 43 - (BOOL)dragShouldLockBarVisibility; |
| 39 | 44 |
| 40 // Returns the top-level window for this button. | 45 // Returns the top-level window for this button. |
| 41 - (NSWindow*)browserWindow; | 46 - (NSWindow*)browserWindow; |
| 42 | 47 |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 + (BookmarkButton*)draggedButton; | 252 + (BookmarkButton*)draggedButton; |
| 248 | 253 |
| 249 | 254 |
| 250 @end // @interface BookmarkButton | 255 @end // @interface BookmarkButton |
| 251 | 256 |
| 252 | 257 |
| 253 @interface BookmarkButton(TestingAPI) | 258 @interface BookmarkButton(TestingAPI) |
| 254 - (void)beginDrag:(NSEvent*)event; | 259 - (void)beginDrag:(NSEvent*)event; |
| 255 @end | 260 @end |
| 256 | 261 |
| OLD | NEW |