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

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

Issue 14579006: Start app shim when app launched. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 7 months 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
« no previous file with comments | « chrome/browser/web_applications/web_app.cc ('k') | chrome/common/mac/app_mode_common.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5c933cd5239e7f8d4d1ba6460265ca76067acf2a..ec3ebcb3012d76c7afe4ae55221081b8d78202d5 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -6,16 +6,21 @@
#import <Cocoa/Cocoa.h>
+#include "base/command_line.h"
#include "base/file_util.h"
#include "base/files/scoped_temp_dir.h"
#include "base/mac/bundle_locations.h"
#include "base/mac/foundation_util.h"
+#include "base/mac/launch_services_util.h"
#include "base/mac/mac_logging.h"
#include "base/mac/mac_util.h"
#include "base/mac/scoped_cftyperef.h"
#include "base/memory/scoped_nsobject.h"
#include "base/strings/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
+#include "chrome/common/chrome_switches.h"
tapted 2013/05/29 06:16:01 nit: don't think this is used
jackhou1 2013/05/29 07:36:06 Done.
+#include "chrome/browser/profiles/profile.h"
tapted 2013/05/29 06:16:01 or this
jackhou1 2013/05/29 07:36:06 Done.
+#include "chrome/browser/ui/web_applications/web_app_ui.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/mac/app_mode_common.h"
@@ -288,6 +293,17 @@ void WebAppShortcutCreator::RevealGeneratedBundleInFinder(
inFileViewerRootedAtPath:nil];
}
+void LaunchShimOnFileThread(ShellIntegration::ShortcutInfo shortcut_info) {
tapted 2013/05/29 06:16:01 can this be a const-reference? I think the closure
jackhou1 2013/05/29 07:36:06 Done.
+ DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
+ base::FilePath shim_path = web_app::GetAppInstallPath(shortcut_info);
+ if (shim_path.empty())
+ return;
+
+ CommandLine command_line(CommandLine::NO_PROGRAM);
+ command_line.AppendSwitch(app_mode::kNoLaunchApp);
+ base::mac::OpenApplicationWithPath(shim_path, command_line, NULL);
+}
+
} // namespace
namespace web_app {
@@ -300,6 +316,12 @@ base::FilePath GetAppInstallPath(
return shortcut_creator.GetShortcutPath();
}
+void MaybeLaunchShortcut(const ShellIntegration::ShortcutInfo& shortcut_info) {
+ content::BrowserThread::PostTask(
+ content::BrowserThread::FILE, FROM_HERE,
+ base::Bind(&LaunchShimOnFileThread, shortcut_info));
+}
+
namespace internals {
base::FilePath GetAppBundleByExtensionId(std::string extension_id) {
« no previous file with comments | « chrome/browser/web_applications/web_app.cc ('k') | chrome/common/mac/app_mode_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698