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

Unified Diff: components/browsing_data_ui/history_notice_utils.cc

Issue 1824333002: Change ShouldShowNoticeAboutOtherFormsOfBrowsingHistory to be asynchronous. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return value. Created 4 years, 9 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
« no previous file with comments | « components/browsing_data_ui/history_notice_utils.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/browsing_data_ui/history_notice_utils.cc
diff --git a/components/browsing_data_ui/history_notice_utils.cc b/components/browsing_data_ui/history_notice_utils.cc
index 7a6fa132e72adfc1a6ce8f16f677a986d5ce9a28..2e46f12ba0afdb199350e720464df37df8215cf2 100644
--- a/components/browsing_data_ui/history_notice_utils.cc
+++ b/components/browsing_data_ui/history_notice_utils.cc
@@ -4,19 +4,26 @@
#include "components/browsing_data_ui/history_notice_utils.h"
+#include "base/callback.h"
#include "components/browser_sync/browser/profile_sync_service.h"
#include "components/history/core/browser/web_history_service.h"
namespace browsing_data_ui {
-bool ShouldShowNoticeAboutOtherFormsOfBrowsingHistory(
+void ShouldShowNoticeAboutOtherFormsOfBrowsingHistory(
const ProfileSyncService* sync_service,
- const history::WebHistoryService* history_service) {
- return sync_service &&
- sync_service->IsSyncActive() &&
- !sync_service->IsUsingSecondaryPassphrase() &&
- history_service &&
- history_service->HasOtherFormsOfBrowsingHistory();
+ const history::WebHistoryService* history_service,
+ base::Callback<void(bool)> callback) {
+ // TODO(msramek): The asynchronicity is technically not needed here now,
+ // but when we change WebHistoryService::HasOtherFormsOfBrowsingHistory()
+ // to communicate with the server, we will get the response asynchronously.
+ // Therefore, we respond asynchronously here as well in anticipation of this
+ // change.
+ callback.Run(sync_service &&
+ sync_service->IsSyncActive() &&
+ !sync_service->IsUsingSecondaryPassphrase() &&
+ history_service &&
+ history_service->HasOtherFormsOfBrowsingHistory());
}
} // namespace browsing_data_ui
« no previous file with comments | « components/browsing_data_ui/history_notice_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698