diff options
author | jeremya@chromium.org <jeremya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-15 06:24:32 +0000 |
---|---|---|
committer | jeremya@chromium.org <jeremya@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-15 06:24:32 +0000 |
commit | ccfab591456e8c231a784823edcd560267bcb382 (patch) | |
tree | 7f083d4ba68a22f7b946d918c3cd2a97c4c5846e /chrome/common/mac | |
parent | 289f05cc53e22a3073ffe1abc14d50f5bc258014 (diff) | |
download | chromium_src-ccfab591456e8c231a784823edcd560267bcb382.zip chromium_src-ccfab591456e8c231a784823edcd560267bcb382.tar.gz chromium_src-ccfab591456e8c231a784823edcd560267bcb382.tar.bz2 |
Rearchitecting the 'app mode' code on mac for v2 apps.
A lot of the old code assumed an outdated model for v2 packaged apps on mac;
specifically that they used to run in their own Chrome process with their own
user data directory. This is no longer the case, and as such it's not possible
to have apps running in their own process, because they need access to profile
information from Chrome.
This patch changes the code so that the 'app mode' .app bundles function more
like shortcuts to open the app in an existing Chrome browser process (launching
Chrome if it's not already running). This allows the app to be launched via
Spotlight and the /Applications folder, and the user can e.g. drag the app onto
the dock like a regular Mac application.
There is as yet no way to trigger the shortcut creation code.
BUG=168080
Review URL: https://chromiumcodereview.appspot.com/11737014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176803 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/mac')
-rw-r--r-- | chrome/common/mac/app_mode_common.h | 13 | ||||
-rw-r--r-- | chrome/common/mac/app_mode_common.mm | 2 |
2 files changed, 11 insertions, 4 deletions
diff --git a/chrome/common/mac/app_mode_common.h b/chrome/common/mac/app_mode_common.h index 265e047..4b604ff 100644 --- a/chrome/common/mac/app_mode_common.h +++ b/chrome/common/mac/app_mode_common.h @@ -15,6 +15,13 @@ namespace app_mode { +// Keys for a custom 'launch platform app' Apple event. When Chrome receives +// this event, it should launch the app specified by the direct key in the +// event, in the profile specified by the 'pdir' key. +const AEEventClass kAEChromeAppClass = 'cApp'; +const AEEventID kAEChromeAppLaunch = 'lnch'; +const AEKeyword kAEProfileDirKey = 'pdir'; + // The key under which the browser's bundle ID will be stored in the // app mode launcher bundle's Info.plist. extern NSString* const kBrowserBundleIDKey; @@ -32,7 +39,7 @@ extern NSString* const kCrAppModeShortcutURLKey; extern NSString* const kCrAppModeUserDataDirKey; // Key for the app's extension path. -extern NSString* const kCrAppModeExtensionPathKey; +extern NSString* const kCrAppModeProfileDirKey; // When the Chrome browser is run, it stores its location in the defaults // system using this key. @@ -92,8 +99,8 @@ struct ChromeAppModeInfo { // Path to the app's user data directory. FilePath user_data_dir; - // Path to the app's extension. - FilePath extension_path; + // Directory of the profile associated with the app. + FilePath profile_dir; }; } // namespace app_mode diff --git a/chrome/common/mac/app_mode_common.mm b/chrome/common/mac/app_mode_common.mm index c6d5573..3efcccb 100644 --- a/chrome/common/mac/app_mode_common.mm +++ b/chrome/common/mac/app_mode_common.mm @@ -11,7 +11,7 @@ NSString* const kCrAppModeShortcutIDKey = @"CrAppModeShortcutID"; NSString* const kCrAppModeShortcutNameKey = @"CrAppModeShortcutName"; NSString* const kCrAppModeShortcutURLKey = @"CrAppModeShortcutURL"; NSString* const kCrAppModeUserDataDirKey = @"CrAppModeUserDataDir"; -NSString* const kCrAppModeExtensionPathKey = @"CrAppModeExtensionPath"; +NSString* const kCrAppModeProfileDirKey = @"CrAppModeProfileDir"; NSString* const kLastRunAppBundlePathPrefsKey = @"LastRunAppBundlePath"; |