- return Launch(application_data, Application::LaunchParams());
-}
-
-Application* ApplicationService::Launch(const GURL& url) {
- namespace keys = xwalk::application_manifest_keys;
-
- const std::string& url_spec = url.spec();
- DCHECK(!url_spec.empty());
- const std::string& app_id = GenerateId(url_spec);
- // FIXME: we need to handle hash collisions.
- DCHECK(!application_storage_->GetApplicationData(app_id));
-
- base::DictionaryValue manifest;
- // FIXME: define permissions!
- manifest.SetString(keys::kURLKey, url_spec);
- manifest.SetString(keys::kNameKey, "XWalk Dummy App");
- manifest.SetString(keys::kVersionKey, "0");
- manifest.SetInteger(keys::kManifestVersionKey, 1);
- std::string error;
- scoped_refptr<ApplicationData> application_data = ApplicationData::Create(
- base::FilePath(), Manifest::COMMAND_LINE, manifest, app_id, &error);
- if (!application_data) {
- LOG(ERROR) << "Error occurred while trying to launch application: "
- << error;
- return NULL;
- }
-
- Application::LaunchParams launch_params;
- launch_params.entry_points = Application::URLKey;
- return Launch(application_data, launch_params);