Commit 234d0d56 authored by nancy's avatar nancy Committed by Commit Bot

Add the pause status checking when sending pause app to publishers.

If the app is unpaused before the user responses to the pause app
dialog, remove the app from pending_pause_requests_, and not pause the
app, when the user click the pause app dialog. Because the app has been
unpaused, and the user can still use the app.

BUG=1068799

Change-Id: I4beef6959bc01746388dcfc0a3d282859e16cd6b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147481Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759113}
parent a0c93abd
...@@ -335,6 +335,7 @@ void AppServiceProxy::UnpauseApps(const std::set<std::string>& app_ids) { ...@@ -335,6 +335,7 @@ void AppServiceProxy::UnpauseApps(const std::set<std::string>& app_ids) {
continue; continue;
} }
pending_pause_requests_.MaybeRemoveApp(app_id);
app_service_->UnpauseApps(app_type, app_id); app_service_->UnpauseApps(app_type, app_id);
} }
} }
...@@ -663,7 +664,9 @@ void AppServiceProxy::OnLoadIconForPauseDialog( ...@@ -663,7 +664,9 @@ void AppServiceProxy::OnLoadIconForPauseDialog(
void AppServiceProxy::OnPauseDialogClosed(apps::mojom::AppType app_type, void AppServiceProxy::OnPauseDialogClosed(apps::mojom::AppType app_type,
const std::string& app_id) { const std::string& app_id) {
app_service_->PauseApp(app_type, app_id); if (pending_pause_requests_.IsPaused(app_id)) {
app_service_->PauseApp(app_type, app_id);
}
} }
#endif // OS_CHROMEOS #endif // OS_CHROMEOS
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment