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({ ...@@ -13,7 +13,7 @@ Polymer({
properties: { properties: {
/** /**
* An array of all saved credit cards. * An array of all saved credit cards.
* @type {!Array<!PaymentsManager.CreditCardEntry>} * @type {!Array<!settings.PaymentsManager.CreditCardEntry>}
*/ */
creditCards: Array, creditCards: Array,
}, },
......
...@@ -17,7 +17,7 @@ Polymer({ ...@@ -17,7 +17,7 @@ Polymer({
properties: { properties: {
/** /**
* A saved credit card. * A saved credit card.
* @type {!PaymentsManager.CreditCardEntry} * @type {!settings.PaymentsManager.CreditCardEntry}
*/ */
creditCard: Object, creditCard: Object,
}, },
......
...@@ -62,7 +62,7 @@ AccessibilityTest.define('SettingsA11yPasswords', { ...@@ -62,7 +62,7 @@ AccessibilityTest.define('SettingsA11yPasswords', {
'object or string', 'Test', settings.routes.PASSWORDS.path); 'object or string', 'Test', settings.routes.PASSWORDS.path);
PasswordManagerImpl.instance_ = new TestPasswordManagerProxy(); PasswordManagerImpl.instance_ = new TestPasswordManagerProxy();
this.passwordManager = PasswordManagerImpl.instance_; this.passwordManager = PasswordManagerImpl.getInstance();
const settingsUi = document.createElement('settings-ui'); const settingsUi = document.createElement('settings-ui');
......
...@@ -126,11 +126,11 @@ cr.define('settings_autofill_page', function() { ...@@ -126,11 +126,11 @@ cr.define('settings_autofill_page', function() {
// Override the AutofillManagerImpl for testing. // Override the AutofillManagerImpl for testing.
autofillManager = new TestAutofillManager(); autofillManager = new TestAutofillManager();
AutofillManagerImpl.instance_ = autofillManager; settings.AutofillManagerImpl.instance_ = autofillManager;
// Override the PaymentsManagerImpl for testing. // Override the PaymentsManagerImpl for testing.
paymentsManager = new TestPaymentsManager(); paymentsManager = new TestPaymentsManager();
PaymentsManagerImpl.instance_ = paymentsManager; settings.PaymentsManagerImpl.instance_ = paymentsManager;
}); });
test('baseLoadAndRemove', function() { test('baseLoadAndRemove', function() {
......
...@@ -60,7 +60,7 @@ cr.define('settings_autofill_section', function() { ...@@ -60,7 +60,7 @@ cr.define('settings_autofill_section', function() {
// Override the AutofillManagerImpl for testing. // Override the AutofillManagerImpl for testing.
this.autofillManager = new TestAutofillManager(); this.autofillManager = new TestAutofillManager();
this.autofillManager.data.addresses = addresses; this.autofillManager.data.addresses = addresses;
AutofillManagerImpl.instance_ = this.autofillManager; settings.AutofillManagerImpl.instance_ = this.autofillManager;
const section = document.createElement('settings-autofill-section'); const section = document.createElement('settings-autofill-section');
section.prefs = {autofill: prefValues}; section.prefs = {autofill: prefValues};
......
...@@ -42,7 +42,7 @@ cr.define('settings_payments_section', function() { ...@@ -42,7 +42,7 @@ cr.define('settings_payments_section', function() {
// Override the PaymentsManagerImpl for testing. // Override the PaymentsManagerImpl for testing.
const paymentsManager = new TestPaymentsManager(); const paymentsManager = new TestPaymentsManager();
paymentsManager.data.creditCards = creditCards; paymentsManager.data.creditCards = creditCards;
PaymentsManagerImpl.instance_ = paymentsManager; settings.PaymentsManagerImpl.instance_ = paymentsManager;
const section = document.createElement('settings-payments-section'); const section = document.createElement('settings-payments-section');
section.prefs = {autofill: prefValues}; 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