Chromium Code Reviews| Index: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
| index 97eb5f57a8c69e4dc60dc633054ae5fa214548fe..ca249649cd380f3c94305aeba2c5abf173163c22 100644 |
| --- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
| +++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm |
| @@ -2106,19 +2106,26 @@ CGFloat FlipXInView(NSView* view, CGFloat width, CGFloat x) { |
| return; |
| } |
| - //TODO(viettrungluu): dropping multiple URLs. |
| - if ([urls count] > 1) |
| - NOTIMPLEMENTED(); |
| + NSInteger numTabsInserted = 0; |
| - // Get the first URL and fix it up. |
| - GURL url(GURL(url_formatter::FixupURL( |
| - base::SysNSStringToUTF8([urls objectAtIndex:0]), std::string()))); |
| + for (id urlString in [urls reverseObjectEnumerator]) { |
| + // Refactor this code. |
| + // https://crbug.com/665261. |
| + GURL url = url_formatter::FixupURL(base::SysNSStringToUTF8(urlString), |
| + std::string()); |
| - // If the URL isn't valid, don't bother. |
| - if (!url.is_valid()) |
| - return; |
| + // If the URL isn't valid, don't bother. |
| + if (!url.is_valid()) |
| + continue; |
| - [self openURL:&url inView:view at:point]; |
| + [self openURL:&url inView:view at:point]; |
| + |
| + numTabsInserted++; |
| + } |
| + |
| + // Now select the last tab inserted. |
| + tabStripModel_->ActivateTabAt( |
|
erikchen
2016/11/18 18:26:21
There are better ways of doing this.
You want to
shahriar
2016/11/21 02:52:38
Thank you very much for the explanation. I make ch
|
| + tabStripModel_->active_index() + numTabsInserted - 1, true); |
| } |
| // (URLDropTargetController protocol) |