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 "components/browser_sync/browser/profile_sync_service.h" | 7 #include "components/browser_sync/browser/profile_sync_service.h" |
8 #include "components/history/core/browser/web_history_service.h" | 8 #include "components/history/core/browser/web_history_service.h" |
9 | 9 |
10 namespace browsing_data_ui { | 10 namespace browsing_data_ui { |
11 | 11 |
12 bool ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( | 12 void ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( |
13 const ProfileSyncService* sync_service, | 13 const ProfileSyncService* sync_service, |
14 const history::WebHistoryService* history_service) { | 14 history::WebHistoryService* history_service, |
15 return sync_service && | 15 base::Callback<void(bool)> callback) { |
16 sync_service->IsSyncActive() && | 16 // TODO(msramek): The API to query other forms of browsing history is not |
sdefresne
2016/03/24 09:50:07
I really dislike this. The function prototype (tak
msramek
2016/03/24 12:53:22
ProfileSyncService* and WebHistoryService* are in
| |
17 !sync_service->IsUsingSecondaryPassphrase() && | 17 // fully available yet, so for now, assume they are not present. |
18 history_service && | 18 callback.Run(false); |
19 history_service->HasOtherFormsOfBrowsingHistory(); | 19 return; |
20 | |
21 if (!sync_service || | |
22 !sync_service->IsSyncActive() || | |
23 sync_service->IsUsingSecondaryPassphrase() || | |
24 !history_service) { | |
25 callback.Run(false); | |
26 return; | |
27 } | |
28 | |
29 history_service->QueryWebAndAppActivity(callback); | |
20 } | 30 } |
21 | 31 |
22 } // namespace browsing_data_ui | 32 } // namespace browsing_data_ui |
OLD | NEW |