summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension.cc
diff options
context:
space:
mode:
authorrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 04:45:50 +0000
committerrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 04:45:50 +0000
commit28375ae7d27179af48386d37e78ca47a2563e0d0 (patch)
treeeeda16c75ff2651afe1cc1738f19226e9cd7ec96 /chrome/common/extensions/extension.cc
parent65b6cf331fd6bebe125635cffd01b595f58638c0 (diff)
downloadchromium_src-28375ae7d27179af48386d37e78ca47a2563e0d0.zip
chromium_src-28375ae7d27179af48386d37e78ca47a2563e0d0.tar.gz
chromium_src-28375ae7d27179af48386d37e78ca47a2563e0d0.tar.bz2
Implement launch disposition for extension-apps.
This change adds an --app-id command switch that signifies that the extension-app with the given id should be launched according to its configuration. It also adds parsing for app.window_type in the manifest and the behavior that when installed and a desktop shortcut is created, the --app-id switch is used rather than the --app switch. BUG=32361 Review URL: http://codereview.chromium.org/573016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38184 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension.cc')
-rw-r--r--chrome/common/extensions/extension.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 7bc46b6..8bd7b2f 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -537,6 +537,18 @@ bool Extension::LoadAppHelper(const DictionaryValue* app, std::string* error) {
return false;
}
+ // launch window type
+ app_launch_window_type_ = APP;
+ std::string window_type_string;
+ if (app->GetString(keys::kAppLaunchWindowType, &window_type_string)) {
+ if (window_type_string == std::string(values::kWindowTypePanel)) {
+ app_launch_window_type_ = PANEL;
+ } else if (window_type_string != std::string(values::kWindowTypeApp)) {
+ *error = errors::kInvalidAppLaunchWindowType;
+ return false;
+ }
+ }
+
// The launch URL is automatically added to the extent.
URLPattern pattern;
pattern.set_scheme(app_launch_url_.scheme());