Chromium Code Reviews| 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..c47b53094e9e6a6bed17843c3e91c93e83b3b80d 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::GetHostDesktopTypeForNativeView( |
| + 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( |
|
Jun Mukai
2014/10/09 23:34:53
This warns me a bit. Right now Athena doesn't use
pkotwicz
2014/10/10 00:51:31
I changed the gyp includes such that Athena uses a
Jun Mukai
2014/10/10 01:01:08
That seems a right direction to me. Eventually I w
|
| + 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; |
| } |