Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(606)

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc

Issue 407483002: Show post-install UI when ephemeral apps are promoted to installed apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@install_guard
Patch Set: Check ephemeral app flag in startup_helper Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_install_ui.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "base/version.h" 17 #include "base/version.h"
18 #include "chrome/browser/about_flags.h" 18 #include "chrome/browser/about_flags.h"
19 #include "chrome/browser/apps/ephemeral_app_launcher.h" 19 #include "chrome/browser/apps/ephemeral_app_launcher.h"
20 #include "chrome/browser/browser_process.h" 20 #include "chrome/browser/browser_process.h"
21 #include "chrome/browser/chrome_notification_types.h" 21 #include "chrome/browser/chrome_notification_types.h"
22 #include "chrome/browser/extensions/crx_installer.h" 22 #include "chrome/browser/extensions/crx_installer.h"
23 #include "chrome/browser/extensions/extension_install_ui_util.h"
23 #include "chrome/browser/extensions/extension_service.h" 24 #include "chrome/browser/extensions/extension_service.h"
24 #include "chrome/browser/extensions/install_tracker.h" 25 #include "chrome/browser/extensions/install_tracker.h"
25 #include "chrome/browser/extensions/webstore_installer.h" 26 #include "chrome/browser/extensions/webstore_installer.h"
26 #include "chrome/browser/gpu/gpu_feature_checker.h" 27 #include "chrome/browser/gpu/gpu_feature_checker.h"
27 #include "chrome/browser/profiles/profile_manager.h" 28 #include "chrome/browser/profiles/profile_manager.h"
28 #include "chrome/browser/signin/signin_manager_factory.h" 29 #include "chrome/browser/signin/signin_manager_factory.h"
29 #include "chrome/browser/signin/signin_promo.h" 30 #include "chrome/browser/signin/signin_promo.h"
30 #include "chrome/browser/signin/signin_tracker_factory.h" 31 #include "chrome/browser/signin/signin_tracker_factory.h"
31 #include "chrome/browser/sync/profile_sync_service.h" 32 #include "chrome/browser/sync/profile_sync_service.h"
32 #include "chrome/browser/sync/profile_sync_service_factory.h" 33 #include "chrome/browser/sync/profile_sync_service_factory.h"
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 547
547 // If the target extension has already been installed ephemerally and is 548 // If the target extension has already been installed ephemerally and is
548 // up to date, it can be promoted to a regular installed extension and 549 // up to date, it can be promoted to a regular installed extension and
549 // downloading from the Web Store is not necessary. 550 // downloading from the Web Store is not necessary.
550 const Extension* extension = ExtensionRegistry::Get(GetProfile())-> 551 const Extension* extension = ExtensionRegistry::Get(GetProfile())->
551 GetExtensionById(params->expected_id, ExtensionRegistry::EVERYTHING); 552 GetExtensionById(params->expected_id, ExtensionRegistry::EVERYTHING);
552 if (extension && approval_->dummy_extension && 553 if (extension && approval_->dummy_extension &&
553 util::IsEphemeralApp(extension->id(), GetProfile()) && 554 util::IsEphemeralApp(extension->id(), GetProfile()) &&
554 extension->version()->CompareTo( 555 extension->version()->CompareTo(
555 *approval_->dummy_extension->version()) >= 0) { 556 *approval_->dummy_extension->version()) >= 0) {
557 install_ui::ShowPostInstallUIForApproval(
558 GetProfile(), *approval_, extension);
559
556 ExtensionService* extension_service = 560 ExtensionService* extension_service =
557 ExtensionSystem::Get(GetProfile())->extension_service(); 561 ExtensionSystem::Get(GetProfile())->extension_service();
558 extension_service->PromoteEphemeralApp(extension, false); 562 extension_service->PromoteEphemeralApp(extension, false);
559 OnInstallSuccess(extension->id()); 563 OnInstallSuccess(extension->id());
560 return true; 564 return true;
561 } 565 }
562 566
563 // Balanced in OnExtensionInstallSuccess() or OnExtensionInstallFailure(). 567 // Balanced in OnExtensionInstallSuccess() or OnExtensionInstallFailure().
564 AddRef(); 568 AddRef();
565 569
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 WebstorePrivateGetEphemeralAppsEnabledFunction:: 904 WebstorePrivateGetEphemeralAppsEnabledFunction::
901 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {} 905 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {}
902 906
903 bool WebstorePrivateGetEphemeralAppsEnabledFunction::RunSync() { 907 bool WebstorePrivateGetEphemeralAppsEnabledFunction::RunSync() {
904 results_ = GetEphemeralAppsEnabled::Results::Create( 908 results_ = GetEphemeralAppsEnabled::Results::Create(
905 EphemeralAppLauncher::IsFeatureEnabled()); 909 EphemeralAppLauncher::IsFeatureEnabled());
906 return true; 910 return true;
907 } 911 }
908 912
909 } // namespace extensions 913 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_install_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698