diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 08:47:48 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-15 08:47:48 +0000 |
commit | 92bcd16fb15f54a0ea510597bebdad7d4d4297dc (patch) | |
tree | 51b8063da05a5d674e993eed0a83aafea6419b7d /chrome/common/extensions/extension.cc | |
parent | f36ed64560f4b52724d223bc870addc5a5e3b73c (diff) | |
download | chromium_src-92bcd16fb15f54a0ea510597bebdad7d4d4297dc.zip chromium_src-92bcd16fb15f54a0ea510597bebdad7d4d4297dc.tar.gz chromium_src-92bcd16fb15f54a0ea510597bebdad7d4d4297dc.tar.bz2 |
Reland 36337: Add launch configuration to apps. Create a desktop shortcut if launch configuration is present. Future
changes will add UI asking if the user wants to create a shortcut first, and change the presentation when the shortcut is
launched.
TBR=erikkay@chromium.org
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36340 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension.cc')
-rw-r--r-- | chrome/common/extensions/extension.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index 2a0f139..9f86ac8 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -506,10 +506,24 @@ bool Extension::LoadAppHelper(const DictionaryValue* app, std::string* error) { return false; } + // launch URL + std::string launch_url_spec; + if (!app->GetString(keys::kAppLaunchUrl, &launch_url_spec)) { + *error = errors::kInvalidAppLaunchUrl; + return false; + } + app_launch_url_ = GURL(launch_url_spec); + if (!app_launch_url_.is_valid()) { + *error = errors::kInvalidAppLaunchUrl; + return false; + } + // The launch URL is automatically an allowed origin. + app_origins_.push_back(app_launch_url_.GetOrigin()); + + // origins ListValue* origins; if (!app->GetList(keys::kAppOrigins, &origins) || origins->GetSize() == 0) { - *error = - ExtensionErrorUtils::FormatErrorMessage(errors::kInvalidAppOrigin, ""); + *error = errors::kInvalidAppOrigin; return false; } for (ListValue::const_iterator iter = origins->begin(); |