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

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 global static initialisers 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..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(

Powered by Google App Engine
This is Rietveld 408576698