| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_install_checker.h" | 9 #include "chrome/browser/extensions/extension_install_checker.h" |
| 10 #include "chrome/browser/extensions/extension_install_prompt.h" | 10 #include "chrome/browser/extensions/extension_install_prompt.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 return web_contents() ? web_contents() : dummy_web_contents_.get(); | 386 return web_contents() ? web_contents() : dummy_web_contents_.get(); |
| 387 } | 387 } |
| 388 | 388 |
| 389 scoped_refptr<ExtensionInstallPrompt::Prompt> | 389 scoped_refptr<ExtensionInstallPrompt::Prompt> |
| 390 EphemeralAppLauncher::CreateInstallPrompt() const { | 390 EphemeralAppLauncher::CreateInstallPrompt() const { |
| 391 const Extension* extension = localized_extension_for_display(); | 391 const Extension* extension = localized_extension_for_display(); |
| 392 DCHECK(extension); // Checked in OnManifestParsed(). | 392 DCHECK(extension); // Checked in OnManifestParsed(). |
| 393 | 393 |
| 394 // Skip the prompt by returning null if the app does not need to display | 394 // Skip the prompt by returning null if the app does not need to display |
| 395 // permission warnings. | 395 // permission warnings. |
| 396 if (extension->permissions_data()->GetPermissionMessageStrings().empty()) | 396 if (extension->permissions_data()->GetLegacyPermissionMessageStrings() |
| 397 .empty()) |
| 397 return NULL; | 398 return NULL; |
| 398 | 399 |
| 399 return make_scoped_refptr(new ExtensionInstallPrompt::Prompt( | 400 return make_scoped_refptr(new ExtensionInstallPrompt::Prompt( |
| 400 ExtensionInstallPrompt::LAUNCH_PROMPT)); | 401 ExtensionInstallPrompt::LAUNCH_PROMPT)); |
| 401 } | 402 } |
| 402 | 403 |
| 403 bool EphemeralAppLauncher::CheckInlineInstallPermitted( | 404 bool EphemeralAppLauncher::CheckInlineInstallPermitted( |
| 404 const base::DictionaryValue& webstore_data, | 405 const base::DictionaryValue& webstore_data, |
| 405 std::string* error) const { | 406 std::string* error) const { |
| 406 *error = ""; | 407 *error = ""; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 468 |
| 468 // CompleteInstall will call Release. | 469 // CompleteInstall will call Release. |
| 469 WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS, | 470 WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS, |
| 470 std::string()); | 471 std::string()); |
| 471 } | 472 } |
| 472 | 473 |
| 473 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { | 474 void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) { |
| 474 // CompleteInstall will call Release. | 475 // CompleteInstall will call Release. |
| 475 CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError); | 476 CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError); |
| 476 } | 477 } |
| OLD | NEW |