Commit 0fe86d0b authored by Demetrios Papadopoulos's avatar Demetrios Papadopoulos Committed by Commit Bot

Settings: Move PaymentsManager and AutofillManager under a namespace.

Previously these were defined at the global scope, which does not play well with
the tools used for migrating to Polymer3. It also pollutes the global namespace.

Bug: 1026426
Change-Id: I8e99c6f83e78a8ac8e1a4073102f60abe70c6448
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2002002
Auto-Submit: Demetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732215}
parent 13fdde75
......@@ -13,7 +13,7 @@ Polymer({
properties: {
/**
* An array of all saved credit cards.
* @type {!Array<!PaymentsManager.CreditCardEntry>}
* @type {!Array<!settings.PaymentsManager.CreditCardEntry>}
*/
creditCards: Array,
},
......
......@@ -17,7 +17,7 @@ Polymer({
properties: {
/**
* A saved credit card.
* @type {!PaymentsManager.CreditCardEntry}
* @type {!settings.PaymentsManager.CreditCardEntry}
*/
creditCard: Object,
},
......
......@@ -62,7 +62,7 @@ AccessibilityTest.define('SettingsA11yPasswords', {
'object or string', 'Test', settings.routes.PASSWORDS.path);
PasswordManagerImpl.instance_ = new TestPasswordManagerProxy();
this.passwordManager = PasswordManagerImpl.instance_;
this.passwordManager = PasswordManagerImpl.getInstance();
const settingsUi = document.createElement('settings-ui');
......
......@@ -126,11 +126,11 @@ cr.define('settings_autofill_page', function() {
// Override the AutofillManagerImpl for testing.
autofillManager = new TestAutofillManager();
AutofillManagerImpl.instance_ = autofillManager;
settings.AutofillManagerImpl.instance_ = autofillManager;
// Override the PaymentsManagerImpl for testing.
paymentsManager = new TestPaymentsManager();
PaymentsManagerImpl.instance_ = paymentsManager;
settings.PaymentsManagerImpl.instance_ = paymentsManager;
});
test('baseLoadAndRemove', function() {
......
......@@ -60,7 +60,7 @@ cr.define('settings_autofill_section', function() {
// Override the AutofillManagerImpl for testing.
this.autofillManager = new TestAutofillManager();
this.autofillManager.data.addresses = addresses;
AutofillManagerImpl.instance_ = this.autofillManager;
settings.AutofillManagerImpl.instance_ = this.autofillManager;
const section = document.createElement('settings-autofill-section');
section.prefs = {autofill: prefValues};
......
......@@ -42,7 +42,7 @@ cr.define('settings_payments_section', function() {
// Override the PaymentsManagerImpl for testing.
const paymentsManager = new TestPaymentsManager();
paymentsManager.data.creditCards = creditCards;
PaymentsManagerImpl.instance_ = paymentsManager;
settings.PaymentsManagerImpl.instance_ = paymentsManager;
const section = document.createElement('settings-payments-section');
section.prefs = {autofill: prefValues};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment