| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/apps/ephemeral_app_launcher.h" | 5 #include "chrome/browser/apps/ephemeral_app_launcher.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_install_prompt.h" | 7 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_util.h" | 9 #include "chrome/browser/extensions/extension_util.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 return true; | 197 return true; |
| 198 } | 198 } |
| 199 | 199 |
| 200 bool EphemeralAppLauncher::CheckInstallValid( | 200 bool EphemeralAppLauncher::CheckInstallValid( |
| 201 const base::DictionaryValue& manifest, | 201 const base::DictionaryValue& manifest, |
| 202 std::string* error) { | 202 std::string* error) { |
| 203 extension_ = Extension::Create( | 203 extension_ = Extension::Create( |
| 204 base::FilePath(), | 204 base::FilePath(), |
| 205 extensions::Manifest::INTERNAL, | 205 extensions::Manifest::INTERNAL, |
| 206 manifest, | 206 manifest, |
| 207 Extension::REQUIRE_KEY | | 207 Extension::REQUIRE_KEY | Extension::FROM_WEBSTORE, |
| 208 Extension::FROM_WEBSTORE | | |
| 209 Extension::IS_EPHEMERAL, | |
| 210 id(), | 208 id(), |
| 211 error); | 209 error); |
| 212 if (!extension_.get()) { | 210 if (!extension_.get()) { |
| 213 *error = kInvalidManifestError; | 211 *error = kInvalidManifestError; |
| 214 return false; | 212 return false; |
| 215 } | 213 } |
| 216 | 214 |
| 217 if (!extension_->is_app()) { | 215 if (!extension_->is_app()) { |
| 218 *error = kExtensionTypeError; | 216 *error = kExtensionTypeError; |
| 219 return false; | 217 return false; |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 LaunchApp(extension); | 273 LaunchApp(extension); |
| 276 WebstoreStandaloneInstaller::CompleteInstall(std::string()); | 274 WebstoreStandaloneInstaller::CompleteInstall(std::string()); |
| 277 } else { | 275 } else { |
| 278 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); | 276 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); |
| 279 } | 277 } |
| 280 } | 278 } |
| 281 | 279 |
| 282 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { | 280 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { |
| 283 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); | 281 WebstoreStandaloneInstaller::CompleteInstall(kLaunchAbortedError); |
| 284 } | 282 } |
| OLD | NEW |