| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/api/webstore_private/webstore_private_api.h" | 5 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 app_list_service->CreateForProfile(GetProfile()); | 541 app_list_service->CreateForProfile(GetProfile()); |
| 542 else | 542 else |
| 543 app_list_service->AutoShowForProfile(GetProfile()); | 543 app_list_service->AutoShowForProfile(GetProfile()); |
| 544 } | 544 } |
| 545 | 545 |
| 546 // If the target extension has already been installed ephemerally and is | 546 // If the target extension has already been installed ephemerally and is |
| 547 // up to date, it can be promoted to a regular installed extension and | 547 // up to date, it can be promoted to a regular installed extension and |
| 548 // downloading from the Web Store is not necessary. | 548 // downloading from the Web Store is not necessary. |
| 549 const Extension* extension = ExtensionRegistry::Get(GetProfile())-> | 549 const Extension* extension = ExtensionRegistry::Get(GetProfile())-> |
| 550 GetExtensionById(params->expected_id, ExtensionRegistry::EVERYTHING); | 550 GetExtensionById(params->expected_id, ExtensionRegistry::EVERYTHING); |
| 551 if (extension && approval_->dummy_extension && | 551 if (extension && approval_->dummy_extension.get() && |
| 552 util::IsEphemeralApp(extension->id(), GetProfile()) && | 552 util::IsEphemeralApp(extension->id(), GetProfile()) && |
| 553 extension->version()->CompareTo( | 553 extension->version()->CompareTo(*approval_->dummy_extension->version()) >= |
| 554 *approval_->dummy_extension->version()) >= 0) { | 554 0) { |
| 555 install_ui::ShowPostInstallUIForApproval( | 555 install_ui::ShowPostInstallUIForApproval( |
| 556 GetProfile(), *approval_, extension); | 556 GetProfile(), *approval_, extension); |
| 557 | 557 |
| 558 ExtensionService* extension_service = | 558 ExtensionService* extension_service = |
| 559 ExtensionSystem::Get(GetProfile())->extension_service(); | 559 ExtensionSystem::Get(GetProfile())->extension_service(); |
| 560 extension_service->PromoteEphemeralApp(extension, false); | 560 extension_service->PromoteEphemeralApp(extension, false); |
| 561 OnInstallSuccess(extension->id()); | 561 OnInstallSuccess(extension->id()); |
| 562 return true; | 562 return true; |
| 563 } | 563 } |
| 564 | 564 |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 902 WebstorePrivateGetEphemeralAppsEnabledFunction:: | 902 WebstorePrivateGetEphemeralAppsEnabledFunction:: |
| 903 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {} | 903 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {} |
| 904 | 904 |
| 905 bool WebstorePrivateGetEphemeralAppsEnabledFunction::RunSync() { | 905 bool WebstorePrivateGetEphemeralAppsEnabledFunction::RunSync() { |
| 906 results_ = GetEphemeralAppsEnabled::Results::Create( | 906 results_ = GetEphemeralAppsEnabled::Results::Create( |
| 907 EphemeralAppLauncher::IsFeatureEnabled()); | 907 EphemeralAppLauncher::IsFeatureEnabled()); |
| 908 return true; | 908 return true; |
| 909 } | 909 } |
| 910 | 910 |
| 911 } // namespace extensions | 911 } // namespace extensions |
| OLD | NEW |