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

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

Issue 466051: Mac: Make a stop-gap visual indicator for dropping URLs on the tab strip. (Closed)
Patch Set: We don't have 10 pixels, so 5 for the DCHECK(). It won't look like at cat though. Created 11 years 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 | « no previous file | chrome/browser/cocoa/tab_strip_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_strip_controller.mm
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm
index 8b151c08b4a3235529e1f2b081d4942b96dfa43f..54a21fd984f4d44fa849e77857e2270a8dd54a03 100644
--- a/chrome/browser/cocoa/tab_strip_controller.mm
+++ b/chrome/browser/cocoa/tab_strip_controller.mm
@@ -1508,42 +1508,49 @@ private:
// Update (possibly showing) the indicator which indicates where an URL drop
// would happen.
- (void)indicateDropURLsAt:(NSPoint)location {
-// TODO(viettrungluu): Make the tabs move around, show an indicator, etc. This
-// requires a re-work of the tabs code....
-#if 0
+ // The minimum y-coordinate at which one should consider place the arrow.
+ const CGFloat arrowBaseY = 25;
+
NSInteger index;
WindowOpenDisposition disposition;
[self droppingURLsAt:location
givesIndex:&index
disposition:&disposition];
+ NSPoint arrowPos = NSMakePoint(0, arrowBaseY);
if (index == -1) {
// Append a tab at the end.
DCHECK(disposition == NEW_FOREGROUND_TAB);
- // TODO(viettrungluu): ...
+ NSInteger lastIndex = [tabArray_ count] - 1;
+ NSRect overRect = [[[tabArray_ objectAtIndex:lastIndex] view] frame];
+ arrowPos.x = overRect.origin.x + overRect.size.width - kTabOverlap / 2.0;
} else {
NSRect overRect = [[[tabArray_ objectAtIndex:index] view] frame];
switch (disposition) {
case NEW_FOREGROUND_TAB:
// Insert tab (to the left of the given tab).
- // TODO(viettrungluu): ...
+ arrowPos.x = overRect.origin.x + kTabOverlap / 2.0;
break;
case CURRENT_TAB:
// Overwrite the given tab.
- // TODO(viettrungluu): ...
+ arrowPos.x = overRect.origin.x + overRect.size.width / 2.0;
break;
default:
NOTREACHED();
}
}
- // TODO(viettrungluu): ...
-#endif
+ [tabView_ setDropArrowPosition:arrowPos];
+ [tabView_ setDropArrowShown:YES];
+ [tabView_ setNeedsDisplay:YES];
}
// Hide the indicator which indicates where an URL drop would happen.
- (void)hideDropURLsIndicator {
-// TODO(viettrungluu): See TODO in |-indicateDropURLsAt:| above.
+ if ([tabView_ dropArrowShown]) {
+ [tabView_ setDropArrowShown:NO];
+ [tabView_ setNeedsDisplay:YES];
+ }
}
- (GTMWindowSheetController*)sheetController {
« no previous file with comments | « no previous file | chrome/browser/cocoa/tab_strip_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698