Commit d4887fb2 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Document opening cleanup.

Add a NSApplicationDelegate call that was introduced in 10.13, and add
future notes for cleanup when 10.13 is the minimum.

Bug: none
Change-Id: I525960f7833332fcbd1f6190657251b62a1fe22e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147883Reviewed-by: default avatarLeonard Grey <lgrey@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758945}
parent 5b3ecb58
......@@ -107,6 +107,7 @@
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "net/base/filename_util.h"
#include "net/base/mac/url_conversions.h"
#include "ui/base/cocoa/focus_window_set.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_mac.h"
......@@ -1427,6 +1428,23 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
net::FilePathToFileURL(base::FilePath([file fileSystemRepresentation]));
gurlVector.push_back(gurl);
}
if (!gurlVector.empty())
[self openUrlsReplacingNTP:gurlVector];
else
NOTREACHED() << "Nothing to open!";
[sender replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
}
// TODO(avi): When Chromium requires 10.13 as a minimum, remove the
// -[NSApplication application:openFiles:] override and the
// kInternetEventClass/kAEGetURL Apple Event registration in -mainMenuCreated.
- (void)application:(NSApplication*)sender openURLs:(NSArray<NSURL*>*)urls {
std::vector<GURL> gurlVector;
for (NSURL* url in urls)
gurlVector.push_back(net::GURLWithNSURL(url));
if (!gurlVector.empty())
[self openUrlsReplacingNTP:gurlVector];
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment