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

Unified Diff: chrome/browser/autofill/options_util.cc

Issue 1020303007: Hide Autofill Wallet checkbox when not syncing autofill data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: preferred Created 5 years, 9 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 | « chrome/browser/autofill/options_util.h ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/options_util.cc
diff --git a/chrome/browser/autofill/options_util.cc b/chrome/browser/autofill/options_util.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ef87ea150fbde56707ab36bb4609c618f9af91a5
--- /dev/null
+++ b/chrome/browser/autofill/options_util.cc
@@ -0,0 +1,21 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/autofill/options_util.h"
+
+#include "chrome/browser/sync/profile_sync_service.h"
+#include "chrome/browser/sync/profile_sync_service_factory.h"
+
+namespace autofill {
+
+bool WalletIntegrationAvailableForProfile(Profile* profile) {
+ // TODO(estade): what to do in the IsManaged case?
+ ProfileSyncService* service =
+ ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile);
+ return service && service->IsSyncEnabledAndLoggedIn() &&
+ service->GetPreferredDataTypes().Has(syncer::AUTOFILL_PROFILE) &&
+ service->GetRegisteredDataTypes().Has(syncer::AUTOFILL_WALLET_DATA);
+}
+
+} // namespace autofill
« no previous file with comments | « chrome/browser/autofill/options_util.h ('k') | chrome/browser/sync/profile_sync_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698