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

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: Removed unnecessary GURL construction and do anti XSS check for bookmark dragging 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
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..cc29dc14ccbd127ec561bf71d45dc66abae1cfbb 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -2106,19 +2106,18 @@ CGFloat FlipXInView(NSView* view, CGFloat width, CGFloat x) {
return;
}
- //TODO(viettrungluu): dropping multiple URLs.
- if ([urls count] > 1)
- NOTIMPLEMENTED();
+ for (id urlString in [urls reverseObjectEnumerator]) {
+ GURL url = url_formatter::FixupURL(base::SysNSStringToUTF8(urlString),
+ std::string());
- // Get the first URL and fix it up.
- GURL url(GURL(url_formatter::FixupURL(
- base::SysNSStringToUTF8([urls objectAtIndex:0]), std::string())));
+ // If the URL isn't valid, don't bother.
+ if (!url.is_valid())
+ continue;
- // If the URL isn't valid, don't bother.
- if (!url.is_valid())
- return;
+ [self openURL:&url inView:view at:point];
+ }
- [self openURL:&url inView:view at:point];
+ tabStripModel_->ActivateTabAt(tabStripModel_->count() - 1, true);
erikchen 2016/11/14 18:22:53 is this necessary? This assumes that the last tab
shahriar 2016/11/15 02:51:12 Right, I fixed it to select the last tab inserted.
}
// (URLDropTargetController protocol)

Powered by Google App Engine
This is Rietveld 408576698