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

Unified Diff: chrome/browser/ui/webui/options/autofill_options_handler.cc

Issue 1578173005: Move Autofill Payments integration checkbox to the sync settings page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace bool with enum in tests Created 4 years, 11 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
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 28fb0307842436ca672ac27af5992454fbbe175b..388ad27cbc8111638e0f316eec242a2190183d77 100644
--- a/chrome/browser/ui/webui/options/autofill_options_handler.cc
+++ b/chrome/browser/ui/webui/options/autofill_options_handler.cc
@@ -23,7 +23,6 @@
#include "chrome/browser/autofill/personal_data_manager_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/ui/autofill/country_combobox_model.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/chromium_strings.h"
@@ -210,9 +209,7 @@ void SetCountryData(const PersonalDataManager& manager,
namespace options {
-AutofillOptionsHandler::AutofillOptionsHandler()
- : personal_data_(NULL), observer_(this) {
-}
+AutofillOptionsHandler::AutofillOptionsHandler() : personal_data_(NULL) {}
AutofillOptionsHandler::~AutofillOptionsHandler() {
if (personal_data_)
@@ -239,7 +236,6 @@ void AutofillOptionsHandler::GetLocalizedValues(
{ "editAddressTitle", IDS_AUTOFILL_EDIT_ADDRESS_CAPTION },
{ "addCreditCardTitle", IDS_AUTOFILL_ADD_CREDITCARD_CAPTION },
{ "editCreditCardTitle", IDS_AUTOFILL_EDIT_CREDITCARD_CAPTION },
- { "autofillWalletOption", IDS_AUTOFILL_USE_WALLET_DATA },
};
RegisterStrings(localized_strings, resources, arraysize(resources));
@@ -260,18 +256,6 @@ void AutofillOptionsHandler::GetLocalizedValues(
localized_strings->SetString(
"manageWalletPaymentMethodsUrl",
autofill::wallet::GetManageInstrumentsUrl(0).spec());
-
- // This is set in loadTimeData to minimize the chance of a load-time flash of
- // content.
- ProfileSyncService* service =
- ProfileSyncServiceFactory::GetInstance()->GetForProfile(
- Profile::FromWebUI(web_ui()));
- if (service)
- observer_.Add(service);
-
- localized_strings->SetBoolean("autofillWalletIntegrationAvailable",
- autofill::WalletIntegrationAvailableForProfile(
- Profile::FromWebUI(web_ui())));
}
void AutofillOptionsHandler::InitializeHandler() {
@@ -283,10 +267,6 @@ void AutofillOptionsHandler::InitializeHandler() {
void AutofillOptionsHandler::InitializePage() {
if (personal_data_)
LoadAutofillData();
-
- // Also update the visibility of the Wallet checkbox (which may have
- // changed since the localized string dictionary was built).
- OnStateChanged();
}
void AutofillOptionsHandler::RegisterMessages() {
@@ -323,14 +303,6 @@ void AutofillOptionsHandler::RegisterMessages() {
// PersonalDataManagerObserver implementation:
void AutofillOptionsHandler::OnPersonalDataChanged() {
LoadAutofillData();
- OnStateChanged();
-}
-
-void AutofillOptionsHandler::OnStateChanged() {
- web_ui()->CallJavascriptFunction(
- "AutofillOptions.walletIntegrationAvailableStateChanged",
- base::FundamentalValue(autofill::WalletIntegrationAvailableForProfile(
- Profile::FromWebUI(web_ui()))));
}
void AutofillOptionsHandler::SetAddressOverlayStrings(
« no previous file with comments | « chrome/browser/ui/webui/options/autofill_options_handler.h ('k') | chrome/browser/ui/webui/options/sync_setup_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698