summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormaf@chromium.org <maf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-21 22:22:15 +0000
committermaf@chromium.org <maf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-21 22:22:15 +0000
commit170b9076bd99d5acfed8242cbf5eb821115e52de (patch)
tree1bc53566d4edc10c18c55a77829ffa0b3fc8c5eb
parentd2fdcf03dce0560f23b26f2aa59802ab39f6a3c6 (diff)
downloadchromium_src-170b9076bd99d5acfed8242cbf5eb821115e52de.zip
chromium_src-170b9076bd99d5acfed8242cbf5eb821115e52de.tar.gz
chromium_src-170b9076bd99d5acfed8242cbf5eb821115e52de.tar.bz2
Live dragging animation for bookmark bar items.
All animation is done by temporarily warping the view, leaving the model alone. The model is not touched until the end when the action is completed and everything is synched up again. Built upon the code that managed the insertion point line, although the line itself is no longer drawn, and it is now calculated based upon the right hand edge of the previous button, not the left edge of the following button, which gives the right results when making temporary insertion space. BUG=72961 R=mark@chromium.org,mrossetti@chromium.org,jrg@chromium.org,pinkerton@chromium.org Review URL: http://codereview.chromium.org/6711066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78936 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h7
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm141
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm14
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm51
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_unittest.mm8
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_button.h11
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm14
-rw-r--r--chrome/browser/ui/cocoa/bookmarks/bookmark_button_unittest.mm6
8 files changed, 150 insertions, 102 deletions
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h
index a2e3dac..3674a21 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h
@@ -260,6 +260,13 @@ willAnimateFromState:(bookmarks::VisualState)oldState
// Set to YES to prevent any node animations. Useful for unit testing so that
// incomplete animations do not cause valgrind complaints.
BOOL ignoreAnimations_;
+
+ // YES if there is a possible drop about to happen in the bar.
+ BOOL hasInsertionPos_;
+
+ // The x point on the bar where the left edge of the new item will end
+ // up if it is dropped.
+ CGFloat insertionPos_;
}
@property(readonly, nonatomic) bookmarks::VisualState visualState;
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
index d9eba43..0858305 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm
@@ -208,8 +208,8 @@ void RecordAppLaunch(Profile* profile, GURL url) {
- (void)addButtonsToView;
- (void)centerNoItemsLabel;
- (void)setNodeForBarMenu;
-
- (void)watchForExitEvent:(BOOL)watch;
+- (void)resetAllButtonPositionsWithAnimation:(BOOL)animate;
@end
@@ -1556,12 +1556,12 @@ void RecordAppLaunch(Profile* profile, GURL url) {
CGFloat delta = desiredSize - frame.size.width;
if (delta) {
frame.size.width = desiredSize;
- [[button animator] setFrame:frame];
+ [button setFrame:frame];
for (NSButton* button in buttons_.get()) {
NSRect buttonFrame = [button frame];
if (buttonFrame.origin.x > frame.origin.x) {
buttonFrame.origin.x += delta;
- [[button animator] setFrame:buttonFrame];
+ [button setFrame:buttonFrame];
}
}
}
@@ -1806,6 +1806,70 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
- (void)draggingEnded:(id<NSDraggingInfo>)info {
[self closeFolderAndStopTrackingMenus];
+ [[BookmarkButton draggedButton] setHidden:NO];
+ [self resetAllButtonPositionsWithAnimation:YES];
+}
+
+// Set insertionPos_ and hasInsertionPos_, and make insertion space for a
+// hypothetical drop with the new button having a left edge of |where|.
+// Gets called only by our view.
+- (void)setDropInsertionPos:(CGFloat)where {
+ if (!hasInsertionPos_ || where != insertionPos_) {
+ insertionPos_ = where;
+ hasInsertionPos_ = YES;
+ CGFloat left = bookmarks::kBookmarkHorizontalPadding;
+ CGFloat paddingWidth = bookmarks::kDefaultBookmarkWidth;
+ BookmarkButton* draggedButton = [BookmarkButton draggedButton];
+ if (draggedButton) {
+ paddingWidth = std::min(bookmarks::kDefaultBookmarkWidth,
+ NSWidth([draggedButton frame]));
+ }
+ // Put all the buttons where they belong, with all buttons to the right
+ // of the insertion point shuffling right to make space for it.
+ for (NSButton* button in buttons_.get()) {
+ // Hidden buttons get no space.
+ if ([button isHidden])
+ continue;
+ NSRect buttonFrame = [button frame];
+ buttonFrame.origin.x = left;
+ // Update "left" for next time around.
+ left += buttonFrame.size.width;
+ if (left > insertionPos_)
+ buttonFrame.origin.x += paddingWidth;
+ left += bookmarks::kBookmarkHorizontalPadding;
+ [[button animator] setFrame:buttonFrame];
+ }
+ }
+}
+
+// Put all visible bookmark bar buttons in their normal locations, either with
+// or without animation according to the |animate| flag.
+// This is generally useful, so is called from various places internally.
+- (void)resetAllButtonPositionsWithAnimation:(BOOL)animate {
+ CGFloat left = bookmarks::kBookmarkHorizontalPadding;
+
+ for (NSButton* button in buttons_.get()) {
+ // Hidden buttons get no space.
+ if ([button isHidden])
+ continue;
+ NSRect buttonFrame = [button frame];
+ buttonFrame.origin.x = left;
+ left += buttonFrame.size.width + bookmarks::kBookmarkHorizontalPadding;
+ if (animate)
+ [[button animator] setFrame:buttonFrame];
+ else
+ [button setFrame:buttonFrame];
+ }
+}
+
+// Clear insertion flag, remove insertion space and put all visible bookmark
+// bar buttons in their normal locations.
+// Gets called only by our view.
+- (void)clearDropInsertionPos {
+ if (hasInsertionPos_) {
+ hasInsertionPos_ = NO;
+ [self resetAllButtonPositionsWithAnimation:YES];
+ }
}
#pragma mark Bridge Notification Handlers
@@ -2067,8 +2131,14 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
}
}
-- (void)bookmarkDragDidEnd:(BookmarkButton*)button {
+- (void)bookmarkDragDidEnd:(BookmarkButton*)button
+ operation:(NSDragOperation)operation {
[self closeFolderAndStopTrackingMenus];
+
+ if (operation == NSDragOperationNone) {
+ [button setHidden:NO];
+ [self resetAllButtonPositionsWithAnimation:YES];
+ }
}
@@ -2211,13 +2281,16 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
int numButtons = displayedButtonCount_;
// If it's a drop strictly between existing buttons ...
- if (destIndex >= 0 && destIndex < numButtons) {
+
+ if (destIndex == 0) {
+ x = 0.5 * bookmarks::kBookmarkHorizontalPadding;
+ } else if (destIndex > 0 && destIndex < numButtons) {
// ... put the indicator right between the buttons.
BookmarkButton* button =
- [buttons_ objectAtIndex:static_cast<NSUInteger>(destIndex)];
+ [buttons_ objectAtIndex:static_cast<NSUInteger>(destIndex-1)];
DCHECK(button);
NSRect buttonFrame = [button frame];
- x = buttonFrame.origin.x - 0.5 * bookmarks::kBookmarkHorizontalPadding;
+ x = NSMaxX(buttonFrame) + 0.5 * bookmarks::kBookmarkHorizontalPadding;
// If it's a drop at the end (past the last button, if there are any) ...
} else if (destIndex == numButtons) {
@@ -2320,19 +2393,10 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
bookmarks::kBookmarkHorizontalPadding;
}
BookmarkButton* newButton = [self buttonForNode:node xOffset:&newOffset];
- CGFloat xOffset =
- NSWidth([newButton frame]) + bookmarks::kBookmarkHorizontalPadding;
- NSUInteger buttonCount = [buttons_ count];
- for (NSUInteger i = buttonIndex; i < buttonCount; ++i) {
- BookmarkButton* button = [buttons_ objectAtIndex:i];
- NSPoint buttonOrigin = [button frame].origin;
- buttonOrigin.x += xOffset;
- [[button animator] setFrameOrigin:buttonOrigin];
- }
++displayedButtonCount_;
[buttons_ insertObject:newButton atIndex:buttonIndex];
[buttonView_ addSubview:newButton];
-
+ [self resetAllButtonPositionsWithAnimation:NO];
// See if any buttons need to be pushed off to or brought in from the side.
[self reconfigureBookmarkBar];
} else {
@@ -2386,7 +2450,6 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
return nodesWereAdded;
}
-// TODO(mrossetti): jrg wants this broken up into smaller functions.
- (void)moveButtonFromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex {
if (fromIndex != toIndex) {
NSInteger buttonCount = (NSInteger)[buttons_ count];
@@ -2396,38 +2459,10 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
// both button indexes are in the visible space.
if (fromIndex < buttonCount && toIndex < buttonCount) {
BookmarkButton* movedButton = [buttons_ objectAtIndex:fromIndex];
- NSRect movedFrame = [movedButton frame];
- NSPoint toOrigin = movedFrame.origin;
- CGFloat xOffset =
- NSWidth(movedFrame) + bookmarks::kBookmarkHorizontalPadding;
- // Hide the button to reduce flickering while drawing the window.
- [movedButton setHidden:YES];
[buttons_ removeObjectAtIndex:fromIndex];
- if (fromIndex < toIndex) {
- // Move the button from left to right within the bar.
- BookmarkButton* targetButton = [buttons_ objectAtIndex:toIndex - 1];
- NSRect toFrame = [targetButton frame];
- toOrigin.x = toFrame.origin.x - NSWidth(movedFrame) + NSWidth(toFrame);
- for (NSInteger i = fromIndex; i < toIndex; ++i) {
- BookmarkButton* button = [buttons_ objectAtIndex:i];
- NSRect frame = [button frame];
- frame.origin.x -= xOffset;
- [[button animator] setFrameOrigin:frame.origin];
- }
- } else {
- // Move the button from right to left within the bar.
- BookmarkButton* targetButton = [buttons_ objectAtIndex:toIndex];
- toOrigin = [targetButton frame].origin;
- for (NSInteger i = fromIndex - 1; i >= toIndex; --i) {
- BookmarkButton* button = [buttons_ objectAtIndex:i];
- NSRect buttonFrame = [button frame];
- buttonFrame.origin.x += xOffset;
- [[button animator] setFrameOrigin:buttonFrame.origin];
- }
- }
[buttons_ insertObject:movedButton atIndex:toIndex];
- [movedButton setFrameOrigin:toOrigin];
[movedButton setHidden:NO];
+ [self resetAllButtonPositionsWithAnimation:NO];
} else if (fromIndex < buttonCount) {
// A button is being removed from the bar and added to off-the-side.
// By now the node has already been inserted into the model so the
@@ -2470,19 +2505,9 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
if (animate && !ignoreAnimations_ && [self isVisible])
NSShowAnimationEffect(NSAnimationEffectDisappearingItemDefault, poofPoint,
NSZeroSize, nil, nil, nil);
- CGFloat xOffset = NSWidth(oldFrame) + bookmarks::kBookmarkHorizontalPadding;
[buttons_ removeObjectAtIndex:buttonIndex];
- NSUInteger buttonCount = [buttons_ count];
- for (NSUInteger i = buttonIndex; i < buttonCount; ++i) {
- BookmarkButton* button = [buttons_ objectAtIndex:i];
- NSRect buttonFrame = [button frame];
- buttonFrame.origin.x -= xOffset;
- [[button animator] setFrame:buttonFrame];
- // If this button is showing its menu then we need to move the menu, too.
- if (button == [folderController_ parentButton])
- [folderController_ offsetFolderMenuWindow:NSMakeSize(xOffset, 0.0)];
- }
--displayedButtonCount_;
+ [self resetAllButtonPositionsWithAnimation:YES];
[self reconfigureBookmarkBar];
} else if (folderController_ &&
[folderController_ parentButton] == offTheSideButton_) {
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
index af7c594..96dd3ff2 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_folder_controller.mm
@@ -1229,6 +1229,14 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
return wasCopiedOrMoved;
}
+// TODO(maf): Implement live drag & drop animation using this hook.
+- (void)setDropInsertionPos:(CGFloat)where {
+}
+
+// TODO(maf): Implement live drag & drop animation using this hook.
+- (void)clearDropInsertionPos {
+}
+
#pragma mark NSWindowDelegate Functions
- (void)windowWillClose:(NSNotification*)notification {
@@ -1313,8 +1321,10 @@ static BOOL ValueInRangeInclusive(CGFloat low, CGFloat value, CGFloat high) {
}
}
-- (void)bookmarkDragDidEnd:(BookmarkButton*)button {
- [barController_ bookmarkDragDidEnd:button];
+- (void)bookmarkDragDidEnd:(BookmarkButton*)button
+ operation:(NSDragOperation)operation {
+ [barController_ bookmarkDragDidEnd:button
+ operation:operation];
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm
index b3bb105..d66a3a7 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -25,6 +25,7 @@
@synthesize dropIndicatorPosition = dropIndicatorPosition_;
@synthesize noItemContainer = noItemContainer_;
+
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
// This probably isn't strictly necessary, but can't hurt.
@@ -105,27 +106,18 @@
return controller_;
}
+// Internal method, needs to be called whenever a change has been made to
+// dropIndicatorShown_ or dropIndicatorPosition_ so it can get the controller
+// to reflect the change by moving buttons around.
+-(void)dropIndicatorChanged {
+ if (dropIndicatorShown_)
+ [controller_ setDropInsertionPos:dropIndicatorPosition_];
+ else
+ [controller_ clearDropInsertionPos];
+}
+
-(void)drawRect:(NSRect)dirtyRect {
[super drawRect:dirtyRect];
-
- // Draw the bookmark-button-dragging drop indicator if necessary.
- if (dropIndicatorShown_) {
- const CGFloat kBarWidth = 1;
- const CGFloat kBarHalfWidth = kBarWidth / 2.0;
- const CGFloat kBarVertPad = 4;
- const CGFloat kBarOpacity = 0.85;
-
- // Prevent the indicator from being clipped on the left.
- CGFloat xLeft = MAX(dropIndicatorPosition_ - kBarHalfWidth, 0);
-
- NSRect uglyBlackBar =
- NSMakeRect(xLeft, kBarVertPad,
- kBarWidth, NSHeight([self bounds]) - 2 * kBarVertPad);
- NSColor* uglyBlackBarColor = [[self window] themeProvider]->
- GetNSColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT, true);
- [[uglyBlackBarColor colorWithAlphaComponent:kBarOpacity] setFill];
- [[NSBezierPath bezierPathWithRect:uglyBlackBar] fill];
- }
}
// Shim function to assist in unit testing.
@@ -146,7 +138,7 @@
if (!showIt) {
if (dropIndicatorShown_) {
dropIndicatorShown_ = NO;
- [self setNeedsDisplay:YES];
+ [self dropIndicatorChanged];
}
} else {
CGFloat x =
@@ -156,7 +148,7 @@
if (!dropIndicatorShown_ || dropIndicatorPosition_ != x) {
dropIndicatorShown_ = YES;
dropIndicatorPosition_ = x;
- [self setNeedsDisplay:YES];
+ [self dropIndicatorChanged];
}
}
@@ -171,26 +163,25 @@
// drop indicator if one was shown.
if (dropIndicatorShown_) {
dropIndicatorShown_ = NO;
- [self setNeedsDisplay:YES];
+ [self dropIndicatorChanged];
}
}
- (void)draggingEnded:(id<NSDraggingInfo>)info {
- // For now, we just call |-draggingExited:|.
- [self draggingExited:info];
+ [[BookmarkButton draggedButton] setHidden:NO];
+ if (dropIndicatorShown_) {
+ dropIndicatorShown_ = NO;
+ [self dropIndicatorChanged];
+ }
+ [controller_ draggingEnded:info];
}
- (BOOL)wantsPeriodicDraggingUpdates {
- // TODO(port): This should probably return |YES| and the controller should
- // slide the existing bookmark buttons interactively to the side to make
- // room for the about-to-be-dropped bookmark.
return YES;
}
- (NSDragOperation)draggingUpdated:(id<NSDraggingInfo>)info {
// For now it's the same as draggingEntered:.
- // TODO(jrg): once we return YES for wantsPeriodicDraggingUpdates,
- // this should ping the controller_ to perform animations.
return [self draggingEntered:info];
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_unittest.mm
index c847a61..ccfb564c 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_view_unittest.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -144,6 +144,12 @@ namespace {
return NSDragOperationNone;
}
+- (void)setDropInsertionPos:(CGFloat)where {
+}
+
+- (void)clearDropInsertionPos {
+}
+
@end
namespace {
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.h b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.h
index 3ab16e6..5865147 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.h
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -53,7 +53,8 @@ class ThemeProvider;
// This is called after the drag has finished, for any reason.
// We particularly need this so we can hide bookmark folder menus and stop
// doing that hover thing.
-- (void)bookmarkDragDidEnd:(BookmarkButton*)button;
+- (void)bookmarkDragDidEnd:(BookmarkButton*)button
+ operation:(NSDragOperation)operation;
@end
@@ -122,6 +123,12 @@ class ThemeProvider;
// http://crbug.com/35968
- (CGFloat)indicatorPosForDragToPoint:(NSPoint)point;
+// Used to tell the controller that room should be made for a drop.
+- (void)setDropInsertionPos:(CGFloat)where;
+
+// Used to tell the controller to stop making room for a drop.
+- (void)clearDropInsertionPos;
+
// Return the theme provider associated with this browser window.
- (ui::ThemeProvider*)themeProvider;
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm
index 4938f46..b20642a 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -197,13 +197,13 @@ BookmarkButton* gDraggedButton = nil; // Weak
dragMouseOffset_ = [self convertPointFromBase:[event locationInWindow]];
dragPending_ = YES;
gDraggedButton = self;
- [[self animator] setHidden:YES];
CGFloat yAt = [self bounds].size.height;
NSSize dragOffset = NSMakeSize(0.0, 0.0);
- [self dragImage:[self dragImage] at:NSMakePoint(0, yAt) offset:dragOffset
+ NSImage* image = [self dragImage];
+ [self setHidden:YES];
+ [self dragImage:image at:NSMakePoint(0, yAt) offset:dragOffset
event:event pasteboard:pboard source:self slideBack:YES];
-
[self setHidden:NO];
// And we're done.
@@ -242,7 +242,8 @@ BookmarkButton* gDraggedButton = nil; // Weak
gDraggedButton = nil;
// Inform delegate of drag source that we're finished dragging,
// so it can close auto-opened bookmark folders etc.
- [delegate_ bookmarkDragDidEnd:self];
+ [delegate_ bookmarkDragDidEnd:self
+ operation:operation];
// Tell delegate if it should delete us.
if (operation & NSDragOperationDelete) {
dragEndScreenLocation_ = aPoint;
@@ -352,7 +353,8 @@ BookmarkButton* gDraggedButton = nil; // Weak
} else {
// Mouse tracked out of button during menu track. Hide menus.
if (!wasInside)
- [delegate_ bookmarkDragDidEnd:self];
+ [delegate_ bookmarkDragDidEnd:self
+ operation:NSDragOperationNone];
}
}
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_unittest.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_unittest.mm
index d45132f..49f54de 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_unittest.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_unittest.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -53,9 +53,9 @@
didDragToTrashCount_++;
}
-- (void)bookmarkDragDidEnd:(BookmarkButton*)button {
+- (void)bookmarkDragDidEnd:(BookmarkButton*)button
+ operation:(NSDragOperation)operation {
}
-
@end
namespace {