| 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/scoped_nsobject.h" | 8 #include "base/scoped_nsobject.h" |
| 9 #import "chrome/browser/cocoa/bookmark_bar_constants.h" // namespace bookmarks | 9 #import "chrome/browser/cocoa/bookmark_bar_constants.h" // namespace bookmarks |
| 10 #import "chrome/browser/cocoa/bookmark_bar_controller.h" | 10 #import "chrome/browser/cocoa/bookmark_bar_controller.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 - (IBAction)openBookmarkFolderFromButton:(id)sender { | 27 - (IBAction)openBookmarkFolderFromButton:(id)sender { |
| 28 [[self folderTarget] openBookmarkFolderFromButton:sender]; | 28 [[self folderTarget] openBookmarkFolderFromButton:sender]; |
| 29 } | 29 } |
| 30 @end | 30 @end |
| 31 | 31 |
| 32 // Don't use a high window level when running unit tests -- it'll | 32 // Don't use a high window level when running unit tests -- it'll |
| 33 // interfere with anything else you are working on. | 33 // interfere with anything else you are working on. |
| 34 @interface BookmarkBarFolderControllerLow : BookmarkBarFolderController { | 34 @interface BookmarkBarFolderControllerLow : BookmarkBarFolderController { |
| 35 BOOL realTopLeft_; // Use the real windowTopLeft call? | 35 BOOL realTopLeft_; // Use the real windowTopLeft call? |
| 36 } | 36 } |
| 37 @property BOOL realTopLeft; | 37 @property (nonatomic) BOOL realTopLeft; |
| 38 @end | 38 @end |
| 39 | 39 |
| 40 | 40 |
| 41 @implementation BookmarkBarFolderControllerLow | 41 @implementation BookmarkBarFolderControllerLow |
| 42 | 42 |
| 43 @synthesize realTopLeft = realTopLeft_; | 43 @synthesize realTopLeft = realTopLeft_; |
| 44 | 44 |
| 45 - (void)configureWindowLevel { | 45 - (void)configureWindowLevel { |
| 46 // Intentionally empty. | 46 // Intentionally empty. |
| 47 } | 47 } |
| 48 | 48 |
| 49 - (NSPoint)windowTopLeft { | 49 - (NSPoint)windowTopLeft { |
| 50 return realTopLeft_ ? [super windowTopLeft] : NSMakePoint(200,200); | 50 return realTopLeft_ ? [super windowTopLeft] : NSMakePoint(200,200); |
| 51 } | 51 } |
| 52 | 52 |
| 53 @end | 53 @end |
| 54 | 54 |
| 55 | 55 |
| 56 @interface BookmarkBarFolderControllerPong : BookmarkBarFolderControllerLow { | 56 @interface BookmarkBarFolderControllerPong : BookmarkBarFolderControllerLow { |
| 57 BOOL childFolderWillShow_; | 57 BOOL childFolderWillShow_; |
| 58 BOOL childFolderWillClose_; | 58 BOOL childFolderWillClose_; |
| 59 } | 59 } |
| 60 @property(readonly) BOOL childFolderWillShow; | 60 @property (nonatomic, readonly) BOOL childFolderWillShow; |
| 61 @property(readonly) BOOL childFolderWillClose; | 61 @property (nonatomic, readonly) BOOL childFolderWillClose; |
| 62 @end | 62 @end |
| 63 | 63 |
| 64 @implementation BookmarkBarFolderControllerPong | 64 @implementation BookmarkBarFolderControllerPong |
| 65 @synthesize childFolderWillShow = childFolderWillShow_; | 65 @synthesize childFolderWillShow = childFolderWillShow_; |
| 66 @synthesize childFolderWillClose = childFolderWillClose_; | 66 @synthesize childFolderWillClose = childFolderWillClose_; |
| 67 | 67 |
| 68 - (void)childFolderWillShow:(id<BookmarkButtonControllerProtocol>)child { | 68 - (void)childFolderWillShow:(id<BookmarkButtonControllerProtocol>)child { |
| 69 childFolderWillShow_ = YES; | 69 childFolderWillShow_ = YES; |
| 70 } | 70 } |
| 71 | 71 |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 EXPECT_TRUE(NSContainsRect(screenFrame, | 390 EXPECT_TRUE(NSContainsRect(screenFrame, |
| 391 [[bbfc window] frame])); | 391 [[bbfc window] frame])); |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 | 394 |
| 395 @interface FakedDragInfo : NSObject { | 395 @interface FakedDragInfo : NSObject { |
| 396 @public | 396 @public |
| 397 NSPoint dropLocation_; | 397 NSPoint dropLocation_; |
| 398 NSDragOperation sourceMask_; | 398 NSDragOperation sourceMask_; |
| 399 } | 399 } |
| 400 @property (assign) NSPoint dropLocation; | 400 @property (nonatomic, assign) NSPoint dropLocation; |
| 401 - (void)setDraggingSourceOperationMask:(NSDragOperation)mask; | 401 - (void)setDraggingSourceOperationMask:(NSDragOperation)mask; |
| 402 @end | 402 @end |
| 403 | 403 |
| 404 @implementation FakedDragInfo | 404 @implementation FakedDragInfo |
| 405 | 405 |
| 406 @synthesize dropLocation = dropLocation_; | 406 @synthesize dropLocation = dropLocation_; |
| 407 | 407 |
| 408 - (id)init { | 408 - (id)init { |
| 409 if ((self = [super init])) { | 409 if ((self = [super init])) { |
| 410 dropLocation_ = NSZeroPoint; | 410 dropLocation_ = NSZeroPoint; |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1245 [folder deleteBookmark:folder]; | 1245 [folder deleteBookmark:folder]; |
| 1246 EXPECT_FALSE([folder folderController]); | 1246 EXPECT_FALSE([folder folderController]); |
| 1247 } | 1247 } |
| 1248 | 1248 |
| 1249 // TODO(jrg): draggingEntered: and draggingExited: trigger timers so | 1249 // TODO(jrg): draggingEntered: and draggingExited: trigger timers so |
| 1250 // they are hard to test. Factor out "fire timers" into routines | 1250 // they are hard to test. Factor out "fire timers" into routines |
| 1251 // which can be overridden to fire immediately to make behavior | 1251 // which can be overridden to fire immediately to make behavior |
| 1252 // confirmable. | 1252 // confirmable. |
| 1253 // There is a similar problem with mouseEnteredButton: and | 1253 // There is a similar problem with mouseEnteredButton: and |
| 1254 // mouseExitedButton:. | 1254 // mouseExitedButton:. |
| OLD | NEW |