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

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

Issue 2502483002: Fixed dragging a folder from bookmark manager to open all elements in new tabs (Closed)
Patch Set: Fixed tab selection when drag/drop to TabStrip Created 4 years, 1 month 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/ui/cocoa/toolbar/toolbar_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698