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

Unified Diff: chrome/browser/ui/search/search_tab_helper.cc

Issue 940043002: Use GetPreferredDataTypes rather than GetActiveDataTypes when performing sync check for chrome sugg… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | chrome/browser/ui/search/search_tab_helper_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/search/search_tab_helper.cc
diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc
index d78a8cfbe80fbfc936690b0a5f89714b02387118..3c4af9745d0404d84336acba969a3fbac9c248e9 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -123,14 +123,15 @@ void RecordNewTabLoadTime(content::WebContents* contents) {
core_tab_helper->set_new_tab_start_time(base::TimeTicks());
}
-// Returns true if the user is signed in and full history sync is enabled,
-// and false otherwise.
+// Returns true if the user wants to sync history. This function returning true
+// is not a guarantee that history is being synced, but it can be used to
+// disable a feature that should not be shown to users who prefer not to sync
+// their history.
bool IsHistorySyncEnabled(Profile* profile) {
ProfileSyncService* sync =
ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile);
return sync &&
- sync->SyncActive() &&
- sync->GetActiveDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES);
+ sync->GetPreferredDataTypes().Has(syncer::HISTORY_DELETE_DIRECTIVES);
}
bool OmniboxHasFocus(OmniboxView* omnibox) {
« no previous file with comments | « no previous file | chrome/browser/ui/search/search_tab_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698