Chromium Code Reviews| 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..2610433af5bd54451570be2e191ed8ede04429f0 100644 |
| --- a/components/browsing_data_ui/history_notice_utils.cc |
| +++ b/components/browsing_data_ui/history_notice_utils.cc |
| @@ -4,6 +4,7 @@ |
| #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" |
| @@ -11,12 +12,18 @@ namespace browsing_data_ui { |
| bool ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( |
|
msarda
2016/03/23 10:35:42
Fix the return type.
msramek
2016/03/23 10:56:51
Ah, yes. It linked successfully, because it's not
|
| 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 |