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

Unified Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc

Issue 634313004: Display dialog when app install succeeds / fails on Athena (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
index 4a12ad74777e8e8daf0be632455633130525a737..b33e91c66bab0e555bc23a536042fd5c60652b25 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
@@ -106,6 +106,12 @@ scoped_ptr<WebstoreInstaller::Approval> PendingApprovals::PopApproval(
return scoped_ptr<WebstoreInstaller::Approval>();
}
+chrome::HostDesktopType GetHostDesktopTypeForWebContents(
+ content::WebContents* contents) {
+ return chrome::GetHostDesktopTypeForNativeWindow(
+ contents->GetTopLevelNativeWindow());
+}
+
static base::LazyInstance<PendingApprovals> g_pending_approvals =
LAZY_INSTANCE_INITIALIZER;
@@ -473,8 +479,8 @@ bool WebstorePrivateCompleteInstallFunction::RunAsync() {
scoped_active_install_.reset(new ScopedActiveInstall(
InstallTracker::Get(GetProfile()), params->expected_id));
- AppListService* app_list_service =
- AppListService::Get(GetCurrentBrowser()->host_desktop_type());
+ AppListService* app_list_service = AppListService::Get(
+ GetHostDesktopTypeForWebContents(GetAssociatedWebContents()));
if (approval_->enable_launcher) {
app_list_service->EnableAppList(GetProfile(),
@@ -568,8 +574,10 @@ WebstorePrivateEnableAppLauncherFunction::
~WebstorePrivateEnableAppLauncherFunction() {}
bool WebstorePrivateEnableAppLauncherFunction::RunSync() {
- AppListService::Get(GetCurrentBrowser()->host_desktop_type())
- ->EnableAppList(GetProfile(), AppListService::ENABLE_VIA_WEBSTORE_LINK);
+ AppListService* app_list_service = AppListService::Get(
+ GetHostDesktopTypeForWebContents(GetAssociatedWebContents()));
+ app_list_service->EnableAppList(GetProfile(),
+ AppListService::ENABLE_VIA_WEBSTORE_LINK);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698