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..13f14043f679845e0d93cf463f883274c7228471 100644 |
--- a/chrome/browser/web_applications/web_app_mac.mm |
+++ b/chrome/browser/web_applications/web_app_mac.mm |
@@ -552,6 +552,14 @@ void UpdateFileTypes(NSMutableDictionary* plist, |
forKey:app_mode::kCFBundleDocumentTypesKey]; |
} |
+void RevealAppShimInFinderForAppOnFileThread( |
+ const web_app::ShortcutInfo& shortcut_info, |
+ const base::FilePath& app_path) { |
+ web_app::WebAppShortcutCreator shortcut_creator( |
+ app_path, shortcut_info, extensions::FileHandlersInfo()); |
+ shortcut_creator.RevealAppShimInFinder(); |
+} |
+ |
} // namespace |
@interface CrCreateAppShortcutCheckboxObserver : NSObject { |
@@ -966,6 +974,9 @@ 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]; |
@@ -1085,6 +1096,16 @@ void UpdateShortcutsForAllApps(Profile* profile, |
callback.Run(); |
} |
+void 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())); |
+} |
+ |
namespace internals { |
bool CreatePlatformShortcuts( |