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

Side by Side Diff: components/browsing_data_ui/history_notice_utils.cc

Issue 1843003003: Add a method to determine when to show a one-time history notice in the CBD dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « components/browsing_data_ui/history_notice_utils.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/callback.h"
8 #include "components/browser_sync/browser/profile_sync_service.h" 8 #include "components/browser_sync/browser/profile_sync_service.h"
9 #include "components/history/core/browser/web_history_service.h" 9 #include "components/history/core/browser/web_history_service.h"
10 10
11 namespace browsing_data_ui { 11 namespace browsing_data_ui {
12 12
13 void ShouldShowNoticeAboutOtherFormsOfBrowsingHistory( 13 void ShouldShowNoticeAboutOtherFormsOfBrowsingHistory(
14 const ProfileSyncService* sync_service, 14 const ProfileSyncService* sync_service,
15 history::WebHistoryService* history_service, 15 history::WebHistoryService* history_service,
16 base::Callback<void(bool)> callback) { 16 base::Callback<void(bool)> callback) {
17 if (!sync_service || 17 if (!sync_service ||
18 !sync_service->IsSyncActive() || 18 !sync_service->IsSyncActive() ||
19 sync_service->IsUsingSecondaryPassphrase() || 19 sync_service->IsUsingSecondaryPassphrase() ||
20 !history_service || 20 !history_service ||
21 !history_service->HasOtherFormsOfBrowsingHistory()) { 21 !history_service->HasOtherFormsOfBrowsingHistory()) {
22 callback.Run(false); 22 callback.Run(false);
23 return; 23 return;
24 } 24 }
25 25
26 history_service->QueryWebAndAppActivity(callback); 26 history_service->QueryWebAndAppActivity(callback);
27 } 27 }
28 28
29 void ShouldPopupDialogAboutOtherFormsOfBrowsingHistory(
30 const ProfileSyncService* sync_service,
31 history::WebHistoryService* history_service,
32 base::Callback<void(bool)> callback) {
33 ShouldShowNoticeAboutOtherFormsOfBrowsingHistory(
34 sync_service, history_service, callback);
35 }
36
29 } // namespace browsing_data_ui 37 } // namespace browsing_data_ui
OLDNEW
« 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