OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/browsing_data_ui/history_notice_utils.h" | 5 #include "components/browsing_data_ui/history_notice_utils.h" |
6 | 6 |
7 #include "base/callback.h" | |
7 #include "components/browser_sync/browser/profile_sync_service.h" | 8 #include "components/browser_sync/browser/profile_sync_service.h" |
8 #include "components/history/core/browser/web_history_service.h" | 9 #include "components/history/core/browser/web_history_service.h" |
9 | 10 |
10 namespace browsing_data_ui { | 11 namespace browsing_data_ui { |
11 | 12 |
12 bool ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( | 13 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
| |
13 const ProfileSyncService* sync_service, | 14 const ProfileSyncService* sync_service, |
14 const history::WebHistoryService* history_service) { | 15 const history::WebHistoryService* history_service, |
15 return sync_service && | 16 base::Callback<void(bool)> callback) { |
16 sync_service->IsSyncActive() && | 17 // TODO(msramek): The asynchronicity is technically not needed here now, |
17 !sync_service->IsUsingSecondaryPassphrase() && | 18 // but when we change WebHistoryService::HasOtherFormsOfBrowsingHistory() |
18 history_service && | 19 // to communicate with the server, we will get the response asynchronously. |
19 history_service->HasOtherFormsOfBrowsingHistory(); | 20 // Therefore, we respond asynchronously here as well in anticipation of this |
21 // change. | |
22 callback.Run(sync_service && | |
23 sync_service->IsSyncActive() && | |
24 !sync_service->IsUsingSecondaryPassphrase() && | |
25 history_service && | |
26 history_service->HasOtherFormsOfBrowsingHistory()); | |
20 } | 27 } |
21 | 28 |
22 } // namespace browsing_data_ui | 29 } // namespace browsing_data_ui |
OLD | NEW |