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

Unified Diff: chrome/browser/web_applications/web_app_mac.mm

Issue 777543002: Create hosted app shims on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unnecessary forward declaration Created 6 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
Index: chrome/browser/web_applications/web_app_mac.mm
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index 89f6e04d7328ac0dbebc23ab1681dbc558f2d0a9..225a0f5b3f259a623cfd95d2ec4e33ced817c577 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -966,11 +966,34 @@ void WebAppShortcutCreator::RevealAppShimInFinder() const {
if (app_path.empty())
return;
+ if (!base::PathExists(app_path)) {
+ app_path = app_path.DirName();
+ }
+
[[NSWorkspace sharedWorkspace]
selectFile:base::mac::FilePathToNSString(app_path)
inFileViewerRootedAtPath:nil];
}
+void WebAppShortcutCreator::RevealAppShimInFinderForApp(
+ Profile* profile,
+ const extensions::Extension* app) {
+ const web_app::ShortcutInfo shortcut_info =
+ ShortcutInfoForExtensionAndProfile(app, profile);
+ content::BrowserThread::PostTask(
+ content::BrowserThread::FILE, FROM_HERE,
+ base::Bind(&RevealAppShimInFinderForAppOnFileThread, shortcut_info,
+ app->path()));
+}
+
+void WebAppShortcutCreator::RevealAppShimInFinderForAppOnFileThread(
+ const ShortcutInfo& shortcut_info,
+ const base::FilePath& app_path) {
+ web_app::WebAppShortcutCreator shortcut_creator(
+ app_path, shortcut_info, extensions::FileHandlersInfo());
+ shortcut_creator.RevealAppShimInFinder();
+}
+
base::FilePath GetAppInstallPath(const ShortcutInfo& shortcut_info) {
WebAppShortcutCreator shortcut_creator(
base::FilePath(), shortcut_info, extensions::FileHandlersInfo());

Powered by Google App Engine
This is Rietveld 408576698