| 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 #include "base/mac/scoped_nsobject.h" | 5 #include "base/mac/scoped_nsobject.h" |
| 6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
| 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 7 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| 8 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" | 8 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h" |
| 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" | 9 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" |
| 10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" | 10 #include "chrome/browser/ui/cocoa/cocoa_profile_test.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 @public | 22 @public |
| 23 int entered_; | 23 int entered_; |
| 24 int exited_; | 24 int exited_; |
| 25 BOOL canDragToTrash_; | 25 BOOL canDragToTrash_; |
| 26 int didDragToTrashCount_; | 26 int didDragToTrashCount_; |
| 27 } | 27 } |
| 28 @end | 28 @end |
| 29 | 29 |
| 30 @implementation FakeButtonDelegate | 30 @implementation FakeButtonDelegate |
| 31 | 31 |
| 32 - (void)fillPasteboard:(NSPasteboard*)pboard | 32 - (NSPasteboardItem*)pasteboardItemForDragOfButton:(BookmarkButton*)button { |
| 33 forDragOfButton:(BookmarkButton*)button { | 33 return nil; |
| 34 } | 34 } |
| 35 | 35 |
| 36 - (void)mouseEnteredButton:(id)buton event:(NSEvent*)event { | 36 - (void)mouseEnteredButton:(id)buton event:(NSEvent*)event { |
| 37 entered_++; | 37 entered_++; |
| 38 } | 38 } |
| 39 | 39 |
| 40 - (void)mouseExitedButton:(id)buton event:(NSEvent*)event { | 40 - (void)mouseExitedButton:(id)buton event:(NSEvent*)event { |
| 41 exited_++; | 41 exited_++; |
| 42 } | 42 } |
| 43 | 43 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 operation:NSDragOperationMove]; | 190 operation:NSDragOperationMove]; |
| 191 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); | 191 EXPECT_EQ(0, delegate.get()->didDragToTrashCount_); |
| 192 [button draggingSession:nil | 192 [button draggingSession:nil |
| 193 endedAtPoint:NSZeroPoint | 193 endedAtPoint:NSZeroPoint |
| 194 operation:NSDragOperationDelete]; | 194 operation:NSDragOperationDelete]; |
| 195 EXPECT_EQ(1, delegate.get()->didDragToTrashCount_); | 195 EXPECT_EQ(1, delegate.get()->didDragToTrashCount_); |
| 196 #pragma clang diagnostic pop | 196 #pragma clang diagnostic pop |
| 197 } | 197 } |
| 198 | 198 |
| 199 } | 199 } |
| OLD | NEW |