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

Unified Diff: chrome/browser/ui/webui/options/autofill_options_handler.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/sync/profile_sync_service.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/autofill_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/autofill_options_handler.cc b/chrome/browser/ui/webui/options/autofill_options_handler.cc
index 0b38cdd77b83b0a329c684556b9bcf455ca844fb..76948064966146d9967658230d0b82c8a48a52e1 100644
--- a/chrome/browser/ui/webui/options/autofill_options_handler.cc
+++ b/chrome/browser/ui/webui/options/autofill_options_handler.cc
@@ -16,6 +16,7 @@
#include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
+#include "chrome/browser/autofill/options_util.h"
#include "chrome/browser/autofill/personal_data_manager_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
@@ -375,10 +376,10 @@ void AutofillOptionsHandler::GetLocalizedValues(
Profile::FromWebUI(web_ui()));
if (service)
observer_.Add(service);
- localized_strings->SetBoolean(
- "autofillWalletIntegrationAvailable",
- service && service->IsSyncEnabledAndLoggedIn() &&
- personal_data_->IsExperimentalWalletIntegrationEnabled());
+
+ localized_strings->SetBoolean("autofillWalletIntegrationAvailable",
+ autofill::WalletIntegrationAvailableForProfile(
+ Profile::FromWebUI(web_ui())));
}
void AutofillOptionsHandler::InitializeHandler() {
@@ -443,12 +444,10 @@ void AutofillOptionsHandler::OnPersonalDataChanged() {
}
void AutofillOptionsHandler::OnStateChanged() {
- ProfileSyncService* service =
- ProfileSyncServiceFactory::GetInstance()->GetForProfile(
- Profile::FromWebUI(web_ui()));
web_ui()->CallJavascriptFunction(
"AutofillOptions.walletIntegrationAvailableStateChanged",
- base::FundamentalValue(service && service->IsSyncEnabledAndLoggedIn()));
+ base::FundamentalValue(autofill::WalletIntegrationAvailableForProfile(
+ Profile::FromWebUI(web_ui()))));
}
void AutofillOptionsHandler::SetAddressOverlayStrings(
« no previous file with comments | « chrome/browser/sync/profile_sync_service.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698