Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1000)

Unified Diff: chrome/browser/cocoa/bookmark_bar_view.mm

Issue 2824004: Not meant to be reviewed or checked in: bookmark bar dragging 06/14/2010 Base URL: git://git.chromium.org/chromium.git
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_controller.mm ('k') | chrome/browser/cocoa/bookmark_button.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/bookmark_bar_view.mm
diff --git a/chrome/browser/cocoa/bookmark_bar_view.mm b/chrome/browser/cocoa/bookmark_bar_view.mm
index f2f2ea5942636b16a53b559cb4626789cc2775bb..298c7a4d232a3a3324e337076ec00641d74ebbab 100644
--- a/chrome/browser/cocoa/bookmark_bar_view.mm
+++ b/chrome/browser/cocoa/bookmark_bar_view.mm
@@ -108,6 +108,7 @@
// Draw the bookmark-button-dragging drop indicator if necessary.
if (dropIndicatorShown_) {
+ NSLog(@"Drop Indicator Should Be Drawn!");
const CGFloat kBarWidth = 1;
const CGFloat kBarHalfWidth = kBarWidth / 2.0;
const CGFloat kBarVertPad = 4;
@@ -182,13 +183,30 @@
// 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 NO;
+ 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.
+ if ([self wantsPeriodicDraggingUpdates]) {
+ BOOL dragCouldHappen = [controller_ shouldShowIndicatorShownForPoint:
+ [info draggingLocation]];
+ if (dragCouldHappen) {
+ [controller_ performPeriodicDraggingUpdates:info];
+ }
+
+ // TODO: Something needs to happen for the case where a drag occurs
+ // from another place (web_drop_target, url_drop_target). Preferrably,
+ // a button will appear that can be dragged. Alternatively, we're still
+ // going to want to show the drop indicator for now. How can we check where
+ // the drop is coming from?
+
+ [controller_ draggingEntered:info]; // allow hover-open to work.
+ return [info draggingSource] ? NSDragOperationMove : NSDragOperationCopy;
+ }
+
return [self draggingEntered:info];
}
« no previous file with comments | « chrome/browser/cocoa/bookmark_bar_controller.mm ('k') | chrome/browser/cocoa/bookmark_button.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698