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

Side by Side Diff: chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc

Issue 1175243009: [Sync] Rename SyncEnabledAndLoggedIn() to CanStartSync(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed a const transition. Created 5 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h" 5 #include "chrome/browser/autocomplete/chrome_autocomplete_provider_client.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 8 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" 9 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
10 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h" 10 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 ServiceAccessType::EXPLICIT_ACCESS) 79 ServiceAccessType::EXPLICIT_ACCESS)
80 ->DeleteMatchingURLsForKeyword(keyword_id, term); 80 ->DeleteMatchingURLsForKeyword(keyword_id, term);
81 } 81 }
82 82
83 bool ChromeAutocompleteProviderClient::TabSyncEnabledAndUnencrypted() { 83 bool ChromeAutocompleteProviderClient::TabSyncEnabledAndUnencrypted() {
84 // Check field trials and settings allow sending the URL on suggest requests. 84 // Check field trials and settings allow sending the URL on suggest requests.
85 ProfileSyncService* service = 85 ProfileSyncService* service =
86 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_); 86 ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile_);
87 sync_driver::SyncPrefs sync_prefs(profile_->GetPrefs()); 87 sync_driver::SyncPrefs sync_prefs(profile_->GetPrefs());
88 return service && 88 return service &&
89 service->IsSyncEnabledAndLoggedIn() && 89 service->CanSyncStart() &&
90 sync_prefs.GetPreferredDataTypes(syncer::UserTypes()).Has( 90 sync_prefs.GetPreferredDataTypes(syncer::UserTypes()).Has(
91 syncer::PROXY_TABS) && 91 syncer::PROXY_TABS) &&
92 !service->GetEncryptedDataTypes().Has(syncer::SESSIONS); 92 !service->GetEncryptedDataTypes().Has(syncer::SESSIONS);
93 } 93 }
94 94
95 void ChromeAutocompleteProviderClient::PrefetchImage(const GURL& url) { 95 void ChromeAutocompleteProviderClient::PrefetchImage(const GURL& url) {
96 BitmapFetcherService* image_service = 96 BitmapFetcherService* image_service =
97 BitmapFetcherServiceFactory::GetForBrowserContext(profile_); 97 BitmapFetcherServiceFactory::GetForBrowserContext(profile_);
98 DCHECK(image_service); 98 DCHECK(image_service);
99 image_service->Prefetch(url); 99 image_service->Prefetch(url);
100 } 100 }
OLDNEW
« no previous file with comments | « chrome/browser/android/precache/precache_launcher.cc ('k') | chrome/browser/extensions/external_pref_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698