Commit 6dff07c7 authored by Dan Beam's avatar Dan Beam Committed by Commit Bot

chrome_pass: move almost all @enums/@typedefs into cr.define()

Previously there were technical issues regarding @typedef in a
non-global (contextual?) scope. These were solved so we can return to a
saner model of exporting enums and @typedefs the same way as everything
else.

This is in hopes of removing cr.exportPath from --chrome_pass at least.
(We may forever benefit from the runtime effects.)

R=dpapad@chromium.org
BUG=986481

Change-Id: Ic07c7c87e3b6f6279167cee182d3c2fa0a10105e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1992697
Commit-Queue: Dan Beam <dbeam@chromium.org>
Auto-Submit: Dan Beam <dbeam@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#730033}
parent 6696ec8d
...@@ -2,24 +2,26 @@ ...@@ -2,24 +2,26 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
cr.exportPath('settings'); cr.define('settings', function() {
/**
* For each line in the item list, the text field will be shown in normal
* style at front of the line. The highlightSuffix will be appended to the end
* of line and emphasized with bold font.
* @typedef {{
* text: string,
* highlightSuffix: ?string,
* }}
*/
let ChromeCleanupRemovalListItem;
/** /**
* For each line in the item list, the text field will be shown in normal style * The default number of items to show for files, registry keys and extensions
* at front of the line. The highlightSuffix will be appended to the end of line * on the detailed view when user-initiated cleanups are enabled.
* and emphasized with bold font. */
* @typedef {{ const CHROME_CLEANUP_DEFAULT_ITEMS_TO_SHOW = 4;
* text: string,
* highlightSuffix: ?string,
* }}
*/
settings.ChromeCleanupRemovalListItem;
/** return {ChromeCleanupRemovalListItem, CHROME_CLEANUP_DEFAULT_ITEMS_TO_SHOW};
* The default number of items to show for files, registry keys and extensions });
* on the detailed view when user-initiated cleanups are enabled.
*/
settings.CHROME_CLEANUP_DEFAULT_ITEMS_TO_SHOW = 4;
/** /**
* @fileoverview * @fileoverview
......
...@@ -2,91 +2,86 @@ ...@@ -2,91 +2,86 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
/** @fileoverview A helper object used for testing the Device page. */
cr.exportPath('settings');
/**
* @typedef {{
* id: string,
* is_dedicated_charger: boolean,
* description: string
* }}
*/
settings.PowerSource;
/**
* @typedef {{
* present: boolean,
* charging: boolean,
* calculating: boolean,
* percent: number,
* statusText: string,
* }}
*/
settings.BatteryStatus;
/**
* Mirrors chromeos::settings::PowerHandler::IdleBehavior.
* @enum {number}
*/
settings.IdleBehavior = {
DISPLAY_OFF_SLEEP: 0,
DISPLAY_OFF: 1,
DISPLAY_ON: 2,
OTHER: 3,
};
/**
* Mirrors chromeos::PowerPolicyController::Action.
* @enum {number}
*/
settings.LidClosedBehavior = {
SUSPEND: 0,
STOP_SESSION: 1,
SHUT_DOWN: 2,
DO_NOTHING: 3,
};
/**
* @typedef {{
* idleBehavior: settings.IdleBehavior,
* idleControlled: boolean,
* lidClosedBehavior: settings.LidClosedBehavior,
* lidClosedControlled: boolean,
* hasLid: boolean,
* }}
*/
settings.PowerManagementSettings;
/**
* A note app's availability for running as note handler app from lock screen.
* Mirrors chromeos::NoteTakingLockScreenSupport.
* @enum {number}
*/
settings.NoteAppLockScreenSupport = {
NOT_SUPPORTED: 0,
NOT_ALLOWED_BY_POLICY: 1,
SUPPORTED: 2,
ENABLED: 3
};
/**
* @typedef {{name:string,
* value:string,
* preferred:boolean,
* lockScreenSupport: settings.NoteAppLockScreenSupport}}
*/
settings.NoteAppInfo;
/**
* @typedef {{
* label: string,
* uuid: string
* }}
*/
settings.ExternalStorage;
cr.define('settings', function() { cr.define('settings', function() {
/**
* @typedef {{
* id: string,
* is_dedicated_charger: boolean,
* description: string
* }}
*/
let PowerSource;
/**
* @typedef {{
* present: boolean,
* charging: boolean,
* calculating: boolean,
* percent: number,
* statusText: string,
* }}
*/
let BatteryStatus;
/**
* Mirrors chromeos::settings::PowerHandler::IdleBehavior.
* @enum {number}
*/
const IdleBehavior = {
DISPLAY_OFF_SLEEP: 0,
DISPLAY_OFF: 1,
DISPLAY_ON: 2,
OTHER: 3,
};
/**
* Mirrors chromeos::PowerPolicyController::Action.
* @enum {number}
*/
const LidClosedBehavior = {
SUSPEND: 0,
STOP_SESSION: 1,
SHUT_DOWN: 2,
DO_NOTHING: 3,
};
/**
* @typedef {{
* idleBehavior: settings.IdleBehavior,
* idleControlled: boolean,
* lidClosedBehavior: settings.LidClosedBehavior,
* lidClosedControlled: boolean,
* hasLid: boolean,
* }}
*/
let PowerManagementSettings;
/**
* A note app's availability for running as note handler app from lock screen.
* Mirrors chromeos::NoteTakingLockScreenSupport.
* @enum {number}
*/
const NoteAppLockScreenSupport =
{NOT_SUPPORTED: 0, NOT_ALLOWED_BY_POLICY: 1, SUPPORTED: 2, ENABLED: 3};
/**
* @typedef {{
* name:string,
* value:string,
* preferred:boolean,
* lockScreenSupport: settings.NoteAppLockScreenSupport,
* }}
*/
let NoteAppInfo;
/**
* @typedef {{
* label: string,
* uuid: string
* }}
*/
let ExternalStorage;
/** @interface */ /** @interface */
class DevicePageBrowserProxy { class DevicePageBrowserProxy {
/** Initializes the mouse and touchpad handler. */ /** Initializes the mouse and touchpad handler. */
...@@ -267,7 +262,15 @@ cr.define('settings', function() { ...@@ -267,7 +262,15 @@ cr.define('settings', function() {
cr.addSingletonGetter(DevicePageBrowserProxyImpl); cr.addSingletonGetter(DevicePageBrowserProxyImpl);
return { return {
DevicePageBrowserProxy: DevicePageBrowserProxy, BatteryStatus,
DevicePageBrowserProxyImpl: DevicePageBrowserProxyImpl, DevicePageBrowserProxy,
DevicePageBrowserProxyImpl,
ExternalStorage,
IdleBehavior,
LidClosedBehavior,
NoteAppInfo,
NoteAppLockScreenSupport,
PowerManagementSettings,
PowerSource,
}; };
}); });
...@@ -2,34 +2,28 @@ ...@@ -2,34 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
/** cr.define('settings', function() {
* @fileoverview /**
* 'settings-storage' is the settings subpage for storage settings. * Enumeration for device state about remaining space.
*/ * These values must be kept in sync with
cr.exportPath('settings'); * StorageManagerHandler::StorageSpaceState in C++ code.
* @enum {number}
/** */
* Enumeration for device state about remaining space. const StorageSpaceState = {NORMAL: 0, LOW: 1, CRITICALLY_LOW: 2};
* These values must be kept in sync with
* StorageManagerHandler::StorageSpaceState in C++ code. /**
* @enum {number} * @typedef {{
*/ * totalSize: string,
settings.StorageSpaceState = { * availableSize: string,
NORMAL: 0, * usedSize: string,
LOW: 1, * usedRatio: number,
CRITICALLY_LOW: 2 * spaceState: settings.StorageSpaceState,
}; * }}
*/
/** let StorageSizeStat;
* @typedef {{
* totalSize: string, return {StorageSpaceState, StorageSizeStat};
* availableSize: string, });
* usedSize: string,
* usedRatio: number,
* spaceState: settings.StorageSpaceState,
* }}
*/
settings.StorageSizeStat;
Polymer({ Polymer({
is: 'settings-storage', is: 'settings-storage',
......
...@@ -2,23 +2,21 @@ ...@@ -2,23 +2,21 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
cr.exportPath('settings');
/**
* An object containing messages for web permissisions origin
* and the messages multidevice feature state.
*
* @typedef {{origin: string,
* enabled: boolean}}
*/
settings.AndroidSmsInfo;
cr.define('settings', function() { cr.define('settings', function() {
/**
* An object containing messages for web permissisions origin
* and the messages multidevice feature state.
*
* @typedef {{origin: string,
* enabled: boolean}}
*/
let AndroidSmsInfo;
/** @interface */ /** @interface */
class MultiDeviceBrowserProxy { class MultiDeviceBrowserProxy {
showMultiDeviceSetupDialog() {} showMultiDeviceSetupDialog() {}
/** @return {!Promise<!MultiDevicePageContentData>} */ /** @return {!Promise<!settings.MultiDevicePageContentData>} */
getPageContentData() {} getPageContentData() {}
/** /**
...@@ -132,7 +130,8 @@ cr.define('settings', function() { ...@@ -132,7 +130,8 @@ cr.define('settings', function() {
cr.addSingletonGetter(MultiDeviceBrowserProxyImpl); cr.addSingletonGetter(MultiDeviceBrowserProxyImpl);
return { return {
MultiDeviceBrowserProxy: MultiDeviceBrowserProxy, AndroidSmsInfo,
MultiDeviceBrowserProxyImpl: MultiDeviceBrowserProxyImpl, MultiDeviceBrowserProxy,
MultiDeviceBrowserProxyImpl,
}; };
}); });
...@@ -49,34 +49,35 @@ cr.define('settings', function() { ...@@ -49,34 +49,35 @@ cr.define('settings', function() {
FURTHER_SETUP_REQUIRED: 8, FURTHER_SETUP_REQUIRED: 8,
}; };
/**
* Container for the initial data that the page requires in order to display
* the correct content. It is also used for receiving status updates during
* use. Note that the host device may be verified (enabled or disabled),
* awaiting verification, or it may have failed setup because it was not able
* to connect to the server.
*
* For each MultiDevice feature (including the "suite" feature, which acts as
* a gatekeeper for the others), the corresponding *State property is an enum
* containing the data necessary to display it. Note that hostDeviceName
* should be undefined if and only if no host has been set up, regardless of
* whether there are potential hosts on the account.
*
* @typedef {{
* mode: !settings.MultiDeviceSettingsMode,
* hostDeviceName: (string|undefined),
* betterTogetherState: !settings.MultiDeviceFeatureState,
* instantTetheringState: !settings.MultiDeviceFeatureState,
* messagesState: !settings.MultiDeviceFeatureState,
* smartLockState: !settings.MultiDeviceFeatureState,
* isAndroidSmsPairingComplete: boolean
* }}
*/
let MultiDevicePageContentData;
return { return {
MultiDeviceSettingsMode: MultiDeviceSettingsMode, MultiDeviceSettingsMode,
MultiDeviceFeature: MultiDeviceFeature, MultiDeviceFeature,
MultiDeviceFeatureState: MultiDeviceFeatureState, MultiDeviceFeatureState,
MultiDevicePageContentData,
}; };
}); });
/**
* Container for the initial data that the page requires in order to display
* the correct content. It is also used for receiving status updates during
* use. Note that the host device may be verified (enabled or disabled),
* awaiting verification, or it may have failed setup because it was not able
* to connect to the server.
*
* For each MultiDevice feature (including the "suite" feature, which acts as a
* gatekeeper for the others), the corresponding *State property is an enum
* containing the data necessary to display it. Note that hostDeviceName should
* be undefined if and only if no host has been set up, regardless of whether
* there are potential hosts on the account.
*
* @typedef {{
* mode: !settings.MultiDeviceSettingsMode,
* hostDeviceName: (string|undefined),
* betterTogetherState: !settings.MultiDeviceFeatureState,
* instantTetheringState: !settings.MultiDeviceFeatureState,
* messagesState: !settings.MultiDeviceFeatureState,
* smartLockState: !settings.MultiDeviceFeatureState,
* isAndroidSmsPairingComplete: boolean
* }}
*/
let MultiDevicePageContentData;
...@@ -2,56 +2,54 @@ ...@@ -2,56 +2,54 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
cr.exportPath('settings');
/**
* @enum {number}
* These values must be kept in sync with the values in
* third_party/cros_system_api/dbus/service_constants.h.
*/
settings.FingerprintResultType = {
SUCCESS: 0,
PARTIAL: 1,
INSUFFICIENT: 2,
SENSOR_DIRTY: 3,
TOO_SLOW: 4,
TOO_FAST: 5,
IMMOBILE: 6,
};
/**
* An object describing a attempt from the fingerprint hardware. The structure
* of this data must be kept in sync with C++ FingerprintHandler.
* @typedef {{
* result: settings.FingerprintResultType,
* indexes: !Array<number>,
* }}
*/
settings.FingerprintAttempt;
/**
* An object describing a scan from the fingerprint hardware. The structure of
* this data must be kept in sync with C++ FingerprintHandler.
* @typedef {{
* result: settings.FingerprintResultType,
* isComplete: boolean,
* percentComplete: number,
* }}
*/
settings.FingerprintScan;
/**
* An object describing the necessary info to display on the fingerprint
* settings. The structure of this data must be kept in sync with
* C++ FingerprintHandler.
* @typedef {{
* fingerprintsList: !Array<string>,
* isMaxed: boolean,
* }}
*/
settings.FingerprintInfo;
cr.define('settings', function() { cr.define('settings', function() {
/**
* @enum {number}
* These values must be kept in sync with the values in
* third_party/cros_system_api/dbus/service_constants.h.
*/
const FingerprintResultType = {
SUCCESS: 0,
PARTIAL: 1,
INSUFFICIENT: 2,
SENSOR_DIRTY: 3,
TOO_SLOW: 4,
TOO_FAST: 5,
IMMOBILE: 6,
};
/**
* An object describing a attempt from the fingerprint hardware. The structure
* of this data must be kept in sync with C++ FingerprintHandler.
* @typedef {{
* result: settings.FingerprintResultType,
* indexes: !Array<number>,
* }}
*/
let FingerprintAttempt;
/**
* An object describing a scan from the fingerprint hardware. The structure of
* this data must be kept in sync with C++ FingerprintHandler.
* @typedef {{
* result: settings.FingerprintResultType,
* isComplete: boolean,
* percentComplete: number,
* }}
*/
let FingerprintScan;
/**
* An object describing the necessary info to display on the fingerprint
* settings. The structure of this data must be kept in sync with
* C++ FingerprintHandler.
* @typedef {{
* fingerprintsList: !Array<string>,
* isMaxed: boolean,
* }}
*/
let FingerprintInfo;
/** @interface */ /** @interface */
class FingerprintBrowserProxy { class FingerprintBrowserProxy {
/** /**
...@@ -159,7 +157,11 @@ cr.define('settings', function() { ...@@ -159,7 +157,11 @@ cr.define('settings', function() {
cr.addSingletonGetter(FingerprintBrowserProxyImpl); cr.addSingletonGetter(FingerprintBrowserProxyImpl);
return { return {
FingerprintBrowserProxy: FingerprintBrowserProxy, FingerprintAttempt,
FingerprintBrowserProxyImpl: FingerprintBrowserProxyImpl, FingerprintBrowserProxy,
FingerprintBrowserProxyImpl,
FingerprintInfo,
FingerprintResultType,
FingerprintScan,
}; };
}); });
...@@ -7,35 +7,34 @@ ...@@ -7,35 +7,34 @@
* the "People" section of Settings, to interact with the browser. Chrome OS * the "People" section of Settings, to interact with the browser. Chrome OS
* only. * only.
*/ */
cr.exportPath('settings');
/** cr.define('settings', function() {
* Information for a Chrome OS Kerberos account. /**
* @typedef {{ * Information for a Chrome OS Kerberos account.
* principalName: string, * @typedef {{
* config: string, * principalName: string,
* isSignedIn: boolean, * config: string,
* isActive: boolean, * isSignedIn: boolean,
* isManaged: boolean, * isActive: boolean,
* passwordWasRemembered: boolean, * isManaged: boolean,
* pic: string, * passwordWasRemembered: boolean,
* validForDuration: string * pic: string,
* }} * validForDuration: string
*/ * }}
settings.KerberosAccount; */
let KerberosAccount;
/** /**
* @typedef {{ * @typedef {{
* error: !settings.KerberosErrorType, * error: !settings.KerberosErrorType,
* errorInfo: !{ * errorInfo: !{
* code: !settings.KerberosConfigErrorCode, * code: !settings.KerberosConfigErrorCode,
* lineIndex: (number|undefined) * lineIndex: (number|undefined)
* } * }
* }} * }}
*/ */
settings.ValidateKerberosConfigResult; let ValidateKerberosConfigResult;
cr.define('settings', function() {
/** /**
* @enum {number} * @enum {number}
* These values must be kept in sync with the ErrorType enum in * These values must be kept in sync with the ErrorType enum in
...@@ -163,9 +162,11 @@ cr.define('settings', function() { ...@@ -163,9 +162,11 @@ cr.define('settings', function() {
cr.addSingletonGetter(KerberosAccountsBrowserProxyImpl); cr.addSingletonGetter(KerberosAccountsBrowserProxyImpl);
return { return {
KerberosErrorType: KerberosErrorType, KerberosAccount,
KerberosConfigErrorCode: KerberosConfigErrorCode, KerberosErrorType,
KerberosAccountsBrowserProxy: KerberosAccountsBrowserProxy, KerberosConfigErrorCode,
KerberosAccountsBrowserProxyImpl: KerberosAccountsBrowserProxyImpl, KerberosAccountsBrowserProxy,
KerberosAccountsBrowserProxyImpl,
ValidateKerberosConfigResult,
}; };
}); });
...@@ -2,34 +2,28 @@ ...@@ -2,34 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
/**
* @fileoverview A helper object to get the status of the sync backend and user
* preferences on what data to sync.
*/
cr.exportPath('settings');
/**
* User preferences for OS sync. 'Registered' means the user has the option to
* select a type. For example, a type might not be registered due to a feature
* flag being disabled.
* @see components/sync/driver/sync_service.h
*
* TODO(jamescook): Encryption options.
*
* @typedef {{
* osAppsRegistered: boolean,
* osAppsSynced: boolean,
* osPreferencesRegistered: boolean,
* osPreferencesSynced: boolean,
* syncAllOsDataTypes: boolean,
* wallpaperEnabled: boolean,
* wifiConfigurationsRegistered: boolean,
* wifiConfigurationsSynced: boolean,
* }}
*/
settings.OsSyncPrefs;
cr.define('settings', function() { cr.define('settings', function() {
/**
* User preferences for OS sync. 'Registered' means the user has the option to
* select a type. For example, a type might not be registered due to a feature
* flag being disabled.
* @see components/sync/driver/sync_service.h
*
* TODO(jamescook): Encryption options.
*
* @typedef {{
* osAppsRegistered: boolean,
* osAppsSynced: boolean,
* osPreferencesRegistered: boolean,
* osPreferencesSynced: boolean,
* syncAllOsDataTypes: boolean,
* wallpaperEnabled: boolean,
* wifiConfigurationsRegistered: boolean,
* wifiConfigurationsSynced: boolean,
* }}
*/
let OsSyncPrefs;
/** @interface */ /** @interface */
class OsSyncBrowserProxy { class OsSyncBrowserProxy {
/** /**
...@@ -86,7 +80,8 @@ cr.define('settings', function() { ...@@ -86,7 +80,8 @@ cr.define('settings', function() {
cr.addSingletonGetter(OsSyncBrowserProxyImpl); cr.addSingletonGetter(OsSyncBrowserProxyImpl);
return { return {
OsSyncBrowserProxy: OsSyncBrowserProxy, OsSyncBrowserProxy,
OsSyncBrowserProxyImpl: OsSyncBrowserProxyImpl, OsSyncBrowserProxyImpl,
OsSyncPrefs,
}; };
}); });
...@@ -2,37 +2,30 @@ ...@@ -2,37 +2,30 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
/**
* @fileoverview A helper object used from the Incompatible Applications section
* to interact with the browser.
*/
cr.exportPath('settings');
/**
* All possible actions to take on an incompatible application.
*
* Must be kept in sync with BlacklistMessageType in
* chrome/browser/win/conflicts/proto/module_list.proto
* @readonly
* @enum {number}
*/
settings.ActionTypes = {
UNINSTALL: 0,
MORE_INFO: 1,
UPGRADE: 2,
};
/**
* @typedef {{
* name: string,
* actionType: {settings.ActionTypes},
* actionUrl: string,
* }}
*/
settings.IncompatibleApplication;
cr.define('settings', function() { cr.define('settings', function() {
/**
* All possible actions to take on an incompatible application.
*
* Must be kept in sync with BlacklistMessageType in
* chrome/browser/win/conflicts/proto/module_list.proto
* @readonly
* @enum {number}
*/
const ActionTypes = {
UNINSTALL: 0,
MORE_INFO: 1,
UPGRADE: 2,
};
/**
* @typedef {{
* name: string,
* actionType: {settings.ActionTypes},
* actionUrl: string,
* }}
*/
let IncompatibleApplication;
/** @interface */ /** @interface */
class IncompatibleApplicationsBrowserProxy { class IncompatibleApplicationsBrowserProxy {
/** /**
...@@ -116,8 +109,9 @@ cr.define('settings', function() { ...@@ -116,8 +109,9 @@ cr.define('settings', function() {
cr.addSingletonGetter(IncompatibleApplicationsBrowserProxyImpl); cr.addSingletonGetter(IncompatibleApplicationsBrowserProxyImpl);
return { return {
IncompatibleApplicationsBrowserProxy: IncompatibleApplicationsBrowserProxy, ActionTypes,
IncompatibleApplicationsBrowserProxyImpl: IncompatibleApplication,
IncompatibleApplicationsBrowserProxyImpl, IncompatibleApplicationsBrowserProxy,
IncompatibleApplicationsBrowserProxyImpl,
}; };
}); });
...@@ -2,30 +2,23 @@ ...@@ -2,30 +2,23 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
/**
* @fileoverview A helper object used from the "Google Accounts" subsection of
* the "People" section of Settings, to interact with the browser. Chrome OS
* only.
*/
cr.exportPath('settings');
/**
* Information for an account managed by Chrome OS AccountManager.
* @typedef {{
* id: string,
* accountType: number,
* isDeviceAccount: boolean,
* isSignedIn: boolean,
* unmigrated: boolean,
* fullName: string,
* email: string,
* pic: string,
* organization: (string|undefined),
* }}
*/
settings.Account;
cr.define('settings', function() { cr.define('settings', function() {
/**
* Information for an account managed by Chrome OS AccountManager.
* @typedef {{
* id: string,
* accountType: number,
* isDeviceAccount: boolean,
* isSignedIn: boolean,
* unmigrated: boolean,
* fullName: string,
* email: string,
* pic: string,
* organization: (string|undefined),
* }}
*/
let Account;
/** @interface */ /** @interface */
class AccountManagerBrowserProxy { class AccountManagerBrowserProxy {
/** /**
...@@ -41,17 +34,17 @@ cr.define('settings', function() { ...@@ -41,17 +34,17 @@ cr.define('settings', function() {
/** /**
* Triggers the re-authentication flow for the account pointed to by * Triggers the re-authentication flow for the account pointed to by
* |account_email|. * |accountEmail|.
* @param {string} account_email * @param {string} accountEmail
*/ */
reauthenticateAccount(account_email) {} reauthenticateAccount(accountEmail) {}
/** /**
* Triggers the migration dialog for the account pointed to by * Triggers the migration dialog for the account pointed to by
* |account_email|. * |accountEmail|.
* @param {string} account_email * @param {string} accountEmail
*/ */
migrateAccount(account_email) {} migrateAccount(accountEmail) {}
/** /**
* Removes |account| from Account Manager. * Removes |account| from Account Manager.
...@@ -80,13 +73,13 @@ cr.define('settings', function() { ...@@ -80,13 +73,13 @@ cr.define('settings', function() {
} }
/** @override */ /** @override */
reauthenticateAccount(account_email) { reauthenticateAccount(accountEmail) {
chrome.send('reauthenticateAccount', [account_email]); chrome.send('reauthenticateAccount', [accountEmail]);
} }
/** @override */ /** @override */
migrateAccount(account_email) { migrateAccount(accountEmail) {
chrome.send('migrateAccount', [account_email]); chrome.send('migrateAccount', [accountEmail]);
} }
/** @override */ /** @override */
...@@ -103,7 +96,8 @@ cr.define('settings', function() { ...@@ -103,7 +96,8 @@ cr.define('settings', function() {
cr.addSingletonGetter(AccountManagerBrowserProxyImpl); cr.addSingletonGetter(AccountManagerBrowserProxyImpl);
return { return {
AccountManagerBrowserProxy: AccountManagerBrowserProxy, Account,
AccountManagerBrowserProxyImpl: AccountManagerBrowserProxyImpl, AccountManagerBrowserProxy,
AccountManagerBrowserProxyImpl,
}; };
}); });
...@@ -2,25 +2,19 @@ ...@@ -2,25 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
/**
* @fileoverview A helper object used from the "Change Picture" subpage of
* the People section to interact with the browser. ChromeOS only.
*/
cr.exportPath('settings');
/**
* An object describing a default image.
* @typedef {{
* author: (string|undefined),
* index: number,
* title: (string|undefined),
* url: string,
* website: (string|undefined)
* }}
*/
settings.DefaultImage;
cr.define('settings', function() { cr.define('settings', function() {
/**
* An object describing a default image.
* @typedef {{
* author: (string|undefined),
* index: number,
* title: (string|undefined),
* url: string,
* website: (string|undefined)
* }}
*/
let DefaultImage;
/** @interface */ /** @interface */
class ChangePictureBrowserProxy { class ChangePictureBrowserProxy {
/** /**
...@@ -113,7 +107,8 @@ cr.define('settings', function() { ...@@ -113,7 +107,8 @@ cr.define('settings', function() {
cr.addSingletonGetter(ChangePictureBrowserProxyImpl); cr.addSingletonGetter(ChangePictureBrowserProxyImpl);
return { return {
ChangePictureBrowserProxy: ChangePictureBrowserProxy, ChangePictureBrowserProxy,
ChangePictureBrowserProxyImpl: ChangePictureBrowserProxyImpl, ChangePictureBrowserProxyImpl,
DefaultImage,
}; };
}); });
...@@ -2,39 +2,33 @@ ...@@ -2,39 +2,33 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
/** cr.define('settings', function() {
* @fileoverview A helper object used from the the Import Data dialog to allow /**
* users to import data (like bookmarks) from other web browsers. * An object describing a source browser profile that may be imported.
*/ * The structure of this data must be kept in sync with C++ ImportDataHandler.
cr.exportPath('settings'); * @typedef {{
* name: string,
/** * index: number,
* An object describing a source browser profile that may be imported. * history: boolean,
* The structure of this data must be kept in sync with C++ ImportDataHandler. * favorites: boolean,
* @typedef {{ * passwords: boolean,
* name: string, * search: boolean,
* index: number, * autofillFormData: boolean,
* history: boolean, * }}
* favorites: boolean, */
* passwords: boolean, let BrowserProfile;
* search: boolean,
* autofillFormData: boolean,
* }}
*/
settings.BrowserProfile;
/** /**
* @enum {string} * @enum {string}
* These string values must be kept in sync with the C++ ImportDataHandler. * These string values must be kept in sync with the C++ ImportDataHandler.
*/ */
settings.ImportDataStatus = { const ImportDataStatus = {
INITIAL: 'initial', INITIAL: 'initial',
IN_PROGRESS: 'inProgress', IN_PROGRESS: 'inProgress',
SUCCEEDED: 'succeeded', SUCCEEDED: 'succeeded',
FAILED: 'failed', FAILED: 'failed',
}; };
cr.define('settings', function() {
/** @interface */ /** @interface */
class ImportDataBrowserProxy { class ImportDataBrowserProxy {
/** /**
...@@ -81,7 +75,9 @@ cr.define('settings', function() { ...@@ -81,7 +75,9 @@ cr.define('settings', function() {
cr.addSingletonGetter(ImportDataBrowserProxyImpl); cr.addSingletonGetter(ImportDataBrowserProxyImpl);
return { return {
ImportDataBrowserProxy: ImportDataBrowserProxy, BrowserProfile,
ImportDataBrowserProxyImpl: ImportDataBrowserProxyImpl, ImportDataStatus,
ImportDataBrowserProxy,
ImportDataBrowserProxyImpl,
}; };
}); });
...@@ -2,23 +2,16 @@ ...@@ -2,23 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
/**
* @fileoverview A helper object used from the the People section to get the
* profile info, which consists of the profile name and icon. Used for both
* Chrome browser and ChromeOS.
*/
cr.exportPath('settings');
/**
* An object describing the profile.
* @typedef {{
* name: string,
* iconUrl: string
* }}
*/
settings.ProfileInfo;
cr.define('settings', function() { cr.define('settings', function() {
/**
* An object describing the profile.
* @typedef {{
* name: string,
* iconUrl: string
* }}
*/
let ProfileInfo;
/** @interface */ /** @interface */
class ProfileInfoBrowserProxy { class ProfileInfoBrowserProxy {
/** /**
...@@ -51,7 +44,5 @@ cr.define('settings', function() { ...@@ -51,7 +44,5 @@ cr.define('settings', function() {
cr.addSingletonGetter(ProfileInfoBrowserProxyImpl); cr.addSingletonGetter(ProfileInfoBrowserProxyImpl);
return { return {ProfileInfo, ProfileInfoBrowserProxyImpl};
ProfileInfoBrowserProxyImpl: ProfileInfoBrowserProxyImpl,
};
}); });
...@@ -2,111 +2,101 @@ ...@@ -2,111 +2,101 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
/**
* @fileoverview A helper object used from the the People section to get the
* status of the sync backend and user preferences on what data to sync. Used
* for both Chrome browser and ChromeOS.
*/
cr.exportPath('settings');
/**
* @typedef {{fullName: (string|undefined),
* givenName: (string|undefined),
* email: string,
* avatarImage: (string|undefined)}}
* @see chrome/browser/ui/webui/settings/people_handler.cc
*/
settings.StoredAccount;
/**
* @typedef {{childUser: (boolean|undefined),
* disabled: (boolean|undefined),
* domain: (string|undefined),
* hasError: (boolean|undefined),
* hasPasswordsOnlyError: (boolean|undefined),
* hasUnrecoverableError: (boolean|undefined),
* managed: (boolean|undefined),
* firstSetupInProgress: (boolean|undefined),
* signedIn: (boolean|undefined),
* signedInUsername: (string|undefined),
* signinAllowed: (boolean|undefined),
* statusAction: (!settings.StatusAction),
* statusActionText: (string|undefined),
* statusText: (string|undefined),
* supervisedUser: (boolean|undefined),
* syncSystemEnabled: (boolean|undefined)}}
* @see chrome/browser/ui/webui/settings/people_handler.cc
*/
settings.SyncStatus;
/**
* Must be kept in sync with the return values of getSyncErrorAction in
* chrome/browser/ui/webui/settings/people_handler.cc
* @enum {string}
*/
settings.StatusAction = {
NO_ACTION: 'noAction', // No action to take.
REAUTHENTICATE: 'reauthenticate', // User needs to reauthenticate.
SIGNOUT_AND_SIGNIN:
'signOutAndSignIn', // User needs to sign out and sign in.
UPGRADE_CLIENT: 'upgradeClient', // User needs to upgrade the client.
ENTER_PASSPHRASE: 'enterPassphrase', // User needs to enter passphrase.
// User needs to go through key retrieval.
RETRIEVE_TRUSTED_VAULT_KEYS: 'retrieveTrustedVaultKeys',
CONFIRM_SYNC_SETTINGS:
'confirmSyncSettings', // User needs to confirm sync settings.
};
/**
* The state of sync. This is the data structure sent back and forth between
* C++ and JS. Its naming and structure is not optimal, but changing it would
* require changes to the C++ handler, which is already functional.
* @typedef {{
* appsRegistered: boolean,
* appsSynced: boolean,
* autofillRegistered: boolean,
* autofillSynced: boolean,
* bookmarksRegistered: boolean,
* bookmarksSynced: boolean,
* encryptAllData: boolean,
* encryptAllDataAllowed: boolean,
* enterPassphraseBody: (string|undefined),
* extensionsRegistered: boolean,
* extensionsSynced: boolean,
* fullEncryptionBody: string,
* passphrase: (string|undefined),
* passphraseRequired: boolean,
* passwordsRegistered: boolean,
* passwordsSynced: boolean,
* paymentsIntegrationEnabled: boolean,
* preferencesRegistered: boolean,
* preferencesSynced: boolean,
* setNewPassphrase: (boolean|undefined),
* syncAllDataTypes: boolean,
* tabsRegistered: boolean,
* tabsSynced: boolean,
* themesRegistered: boolean,
* themesSynced: boolean,
* trustedVaultKeysRequired: boolean,
* typedUrlsRegistered: boolean,
* typedUrlsSynced: boolean,
* }}
*/
settings.SyncPrefs;
/**
* @enum {string}
*/
settings.PageStatus = {
SPINNER: 'spinner', // Before the page has loaded.
CONFIGURE: 'configure', // Preferences ready to be configured.
TIMEOUT: 'timeout', // Preferences loading has timed out.
DONE: 'done', // Sync subpage can be closed now.
PASSPHRASE_FAILED: 'passphraseFailed', // Error in the passphrase.
};
cr.define('settings', function() { cr.define('settings', function() {
/**
* @typedef {{fullName: (string|undefined),
* givenName: (string|undefined),
* email: string,
* avatarImage: (string|undefined)}}
* @see chrome/browser/ui/webui/settings/people_handler.cc
*/
let StoredAccount;
/**
* @typedef {{childUser: (boolean|undefined),
* disabled: (boolean|undefined),
* domain: (string|undefined),
* hasError: (boolean|undefined),
* hasPasswordsOnlyError: (boolean|undefined),
* hasUnrecoverableError: (boolean|undefined),
* managed: (boolean|undefined),
* firstSetupInProgress: (boolean|undefined),
* signedIn: (boolean|undefined),
* signedInUsername: (string|undefined),
* signinAllowed: (boolean|undefined),
* statusAction: (!settings.StatusAction),
* statusActionText: (string|undefined),
* statusText: (string|undefined),
* supervisedUser: (boolean|undefined),
* syncSystemEnabled: (boolean|undefined)}}
* @see chrome/browser/ui/webui/settings/people_handler.cc
*/
let SyncStatus;
/**
* Must be kept in sync with the return values of getSyncErrorAction in
* chrome/browser/ui/webui/settings/people_handler.cc
* @enum {string}
*/
const StatusAction = {
NO_ACTION: 'noAction', // No action to take.
REAUTHENTICATE: 'reauthenticate', // User needs to reauthenticate.
SIGNOUT_AND_SIGNIN:
'signOutAndSignIn', // User needs to sign out and sign in.
UPGRADE_CLIENT: 'upgradeClient', // User needs to upgrade the client.
ENTER_PASSPHRASE: 'enterPassphrase', // User needs to enter passphrase.
// User needs to go through key retrieval.
RETRIEVE_TRUSTED_VAULT_KEYS: 'retrieveTrustedVaultKeys',
CONFIRM_SYNC_SETTINGS:
'confirmSyncSettings', // User needs to confirm sync settings.
};
/**
* The state of sync. This is the data structure sent back and forth between
* C++ and JS. Its naming and structure is not optimal, but changing it would
* require changes to the C++ handler, which is already functional.
* @typedef {{
* appsRegistered: boolean,
* appsSynced: boolean,
* autofillRegistered: boolean,
* autofillSynced: boolean,
* bookmarksRegistered: boolean,
* bookmarksSynced: boolean,
* encryptAllData: boolean,
* encryptAllDataAllowed: boolean,
* enterPassphraseBody: (string|undefined),
* extensionsRegistered: boolean,
* extensionsSynced: boolean,
* fullEncryptionBody: string,
* passphrase: (string|undefined),
* passphraseRequired: boolean,
* passwordsRegistered: boolean,
* passwordsSynced: boolean,
* paymentsIntegrationEnabled: boolean,
* preferencesRegistered: boolean,
* preferencesSynced: boolean,
* setNewPassphrase: (boolean|undefined),
* syncAllDataTypes: boolean,
* tabsRegistered: boolean,
* tabsSynced: boolean,
* themesRegistered: boolean,
* themesSynced: boolean,
* trustedVaultKeysRequired: boolean,
* typedUrlsRegistered: boolean,
* typedUrlsSynced: boolean,
* }}
*/
let SyncPrefs;
/** @enum {string} */
const PageStatus = {
SPINNER: 'spinner', // Before the page has loaded.
CONFIGURE: 'configure', // Preferences ready to be configured.
TIMEOUT: 'timeout', // Preferences loading has timed out.
DONE: 'done', // Sync subpage can be closed now.
PASSPHRASE_FAILED: 'passphraseFailed', // Error in the passphrase.
};
/** /**
* Key to be used with localStorage. * Key to be used with localStorage.
* @type {string} * @type {string}
...@@ -319,7 +309,12 @@ cr.define('settings', function() { ...@@ -319,7 +309,12 @@ cr.define('settings', function() {
cr.addSingletonGetter(SyncBrowserProxyImpl); cr.addSingletonGetter(SyncBrowserProxyImpl);
return { return {
SyncBrowserProxy: SyncBrowserProxy, PageStatus,
SyncBrowserProxyImpl: SyncBrowserProxyImpl, StatusAction,
StoredAccount,
SyncBrowserProxy,
SyncBrowserProxyImpl,
SyncPrefs,
SyncStatus,
}; };
}); });
...@@ -2,15 +2,17 @@ ...@@ -2,15 +2,17 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
cr.exportPath('settings'); cr.define('settings', function() {
/**
* @typedef {{
* enabled: boolean,
* pref: !chrome.settingsPrivate.PrefObject
* }}
*/
let BlockAutoplayStatus;
/** return {BlockAutoplayStatus};
* @typedef {{ });
* enabled: boolean,
* pref: !chrome.settingsPrivate.PrefObject
* }}
*/
let BlockAutoplayStatus;
/** /**
* @fileoverview * @fileoverview
...@@ -142,11 +144,11 @@ Polymer({ ...@@ -142,11 +144,11 @@ Polymer({
} }
}, },
/** @private {BlockAutoplayStatus} */ /** @private {settings.BlockAutoplayStatus} */
blockAutoplayStatus_: { blockAutoplayStatus_: {
type: Object, type: Object,
value: function() { value: function() {
return /** @type {BlockAutoplayStatus} */ ({}); return /** @type {settings.BlockAutoplayStatus} */ ({});
} }
}, },
...@@ -323,7 +325,7 @@ Polymer({ ...@@ -323,7 +325,7 @@ Polymer({
/** /**
* Called when the block autoplay status changes. * Called when the block autoplay status changes.
* @param {BlockAutoplayStatus} autoplayStatus * @param {settings.BlockAutoplayStatus} autoplayStatus
* @private * @private
*/ */
onBlockAutoplayStatusChanged_: function(autoplayStatus) { onBlockAutoplayStatusChanged_: function(autoplayStatus) {
......
...@@ -68,7 +68,7 @@ Polymer({ ...@@ -68,7 +68,7 @@ Polymer({
/** /**
* The list of enrollments displayed. * The list of enrollments displayed.
* @private {!Array<!Enrollment>} * @private {!Array<!settings.Enrollment>}
*/ */
enrollments_: Array, enrollments_: Array,
...@@ -135,7 +135,7 @@ Polymer({ ...@@ -135,7 +135,7 @@ Polymer({
/** /**
* @private * @private
* @param {!Array<!Enrollment>} enrollments * @param {!Array<!settings.Enrollment>} enrollments
*/ */
onEnrollments_: function(enrollments) { onEnrollments_: function(enrollments) {
this.enrollments_ = enrollments; this.enrollments_ = enrollments;
...@@ -210,10 +210,10 @@ Polymer({ ...@@ -210,10 +210,10 @@ Polymer({
/** /**
* @private * @private
* @param {!EnrollmentStatus} response * @param {!settings.EnrollmentStatus} response
*/ */
onEnrolling_: function(response) { onEnrolling_: function(response) {
if (response.code == Ctap2Status.ERR_KEEPALIVE_CANCEL) { if (response.code == settings.Ctap2Status.ERR_KEEPALIVE_CANCEL) {
this.showEnrollmentsPage_(); this.showEnrollmentsPage_();
return; return;
} }
......
...@@ -2,70 +2,69 @@ ...@@ -2,70 +2,69 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
cr.exportPath('settings');
/**
* Ctap2Status contains a subset of CTAP2 status codes. See
* device::CtapDeviceResponseCode for the full list.
* @enum {number}
*/
const Ctap2Status = {
OK: 0x0,
ERR_KEEPALIVE_CANCEL: 0x2D,
};
/**
* Credential represents a CTAP2 resident credential enumerated from a security
* key.
*
* id: (required) The hex encoding of the CBOR-serialized
* PublicKeyCredentialDescriptor of the credential.
*
* relyingPartyId: (required) The RP ID (i.e. the site that created the
* credential; eTLD+n)
*
* userName: (required) The PublicKeyCredentialUserEntity.name
*
* userDisplayName: (required) The PublicKeyCredentialUserEntity.display_name
*
* @typedef {{id: string,
* relyingPartyId: string,
* userName: string,
* userDisplayName: string}}
* @see chrome/browser/ui/webui/settings/settings_security_key_handler.cc
*/
let Credential;
/**
* EnrollmentStatus represents the current status of an enrollment suboperation,
* where 'remaining' is the number of samples left, 'status' is the last
* enrollment status, 'code' indicates the final CtapDeviceResponseCode of the
* operation, and 'enrollment' contains the new Enrollment.
*
* For each enrollment sample, 'status' is set - when the enrollment operation
* reaches an end state, 'code' and, if successful, 'enrollment' are set. |OK|
* indicates successful enrollment. A code of |ERR_KEEPALIVE_CANCEL| indicates
* user-initated cancellation.
*
* @typedef {{status: ?number,
* code: ?Ctap2Status,
* remaining: number,
* enrollment: ?Enrollment}}
* @see chrome/browser/ui/webui/settings/settings_security_key_handler.cc
*/
let EnrollmentStatus;
/**
* Enrollment represents a valid fingerprint template stored on a security key,
* which can be used in a user verification request.
*
* @typedef {{name: string,
* id: string}}
* @see chrome/browser/ui/webui/settings/settings_security_key_handler.cc
*/
let Enrollment;
cr.define('settings', function() { cr.define('settings', function() {
/**
* Ctap2Status contains a subset of CTAP2 status codes. See
* device::CtapDeviceResponseCode for the full list.
* @enum {number}
*/
const Ctap2Status = {
OK: 0x0,
ERR_KEEPALIVE_CANCEL: 0x2D,
};
/**
* Credential represents a CTAP2 resident credential enumerated from a
* security key.
*
* id: (required) The hex encoding of the CBOR-serialized
* PublicKeyCredentialDescriptor of the credential.
*
* relyingPartyId: (required) The RP ID (i.e. the site that created the
* credential; eTLD+n)
*
* userName: (required) The PublicKeyCredentialUserEntity.name
*
* userDisplayName: (required) The PublicKeyCredentialUserEntity.display_name
*
* @typedef {{id: string,
* relyingPartyId: string,
* userName: string,
* userDisplayName: string}}
* @see chrome/browser/ui/webui/settings/settings_security_key_handler.cc
*/
let Credential;
/**
* EnrollmentStatus represents the current status of an enrollment
* suboperation, where 'remaining' is the number of samples left, 'status' is
* the last enrollment status, 'code' indicates the final
* CtapDeviceResponseCode of the operation, and 'enrollment' contains the new
* Enrollment.
*
* For each enrollment sample, 'status' is set - when the enrollment operation
* reaches an end state, 'code' and, if successful, 'enrollment' are set. |OK|
* indicates successful enrollment. A code of |ERR_KEEPALIVE_CANCEL| indicates
* user-initated cancellation.
*
* @typedef {{status: ?number,
* code: ?settings.Ctap2Status,
* remaining: number,
* enrollment: ?settings.Enrollment}}
* @see chrome/browser/ui/webui/settings/settings_security_key_handler.cc
*/
let EnrollmentStatus;
/**
* Enrollment represents a valid fingerprint template stored on a security
* key, which can be used in a user verification request.
*
* @typedef {{name: string,
* id: string}}
* @see chrome/browser/ui/webui/settings/settings_security_key_handler.cc
*/
let Enrollment;
/** @interface */ /** @interface */
class SecurityKeysPINBrowserProxy { class SecurityKeysPINBrowserProxy {
/** /**
...@@ -121,7 +120,7 @@ cr.define('settings', function() { ...@@ -121,7 +120,7 @@ cr.define('settings', function() {
* Enumerates credentials on the authenticator. A correct PIN must have * Enumerates credentials on the authenticator. A correct PIN must have
* previously been supplied via providePIN() before this * previously been supplied via providePIN() before this
* method may be called. * method may be called.
* @return {!Promise<!Array<!Credential>>} * @return {!Promise<!Array<!settings.Credential>>}
*/ */
enumerateCredentials() {} enumerateCredentials() {}
...@@ -187,7 +186,7 @@ cr.define('settings', function() { ...@@ -187,7 +186,7 @@ cr.define('settings', function() {
* previously been supplied via bioEnrollProvidePIN() before this method may * previously been supplied via bioEnrollProvidePIN() before this method may
* be called. * be called.
* *
* @return {!Promise<!Array<!Enrollment>>} * @return {!Promise<!Array<!settings.Enrollment>>}
*/ */
enumerateEnrollments() {} enumerateEnrollments() {}
...@@ -202,8 +201,8 @@ cr.define('settings', function() { ...@@ -202,8 +201,8 @@ cr.define('settings', function() {
* out waiting for a touch, or has successfully processed a touch. Any * out waiting for a touch, or has successfully processed a touch. Any
* errors will fire the 'security-keys-bio-enrollment-error' WebListener. * errors will fire the 'security-keys-bio-enrollment-error' WebListener.
* *
* @return {!Promise<!EnrollmentStatus>} resolves when the enrollment * @return {!Promise<!settings.EnrollmentStatus>} resolves when the
* operation is finished successfully. * enrollment operation is finished successfully.
*/ */
startEnrolling() {} startEnrolling() {}
...@@ -218,7 +217,8 @@ cr.define('settings', function() { ...@@ -218,7 +217,8 @@ cr.define('settings', function() {
* Deletes the enrollment with the given ID. * Deletes the enrollment with the given ID.
* *
* @param {string} id * @param {string} id
* @return {!Promise<!Array<!Enrollment>>} The remaining enrollments. * @return {!Promise<!Array<!settings.Enrollment>>} The remaining
* enrollments.
*/ */
deleteEnrollment(id) {} deleteEnrollment(id) {}
...@@ -227,7 +227,8 @@ cr.define('settings', function() { ...@@ -227,7 +227,8 @@ cr.define('settings', function() {
* *
* @param {string} id * @param {string} id
* @param {string} name * @param {string} name
* @return {!Promise<!Array<!Enrollment>>} The updated list of enrollments. * @return {!Promise<!Array<!settings.Enrollment>>} The updated list of
* enrollments.
*/ */
renameEnrollment(id, name) {} renameEnrollment(id, name) {}
...@@ -350,14 +351,17 @@ cr.define('settings', function() { ...@@ -350,14 +351,17 @@ cr.define('settings', function() {
cr.addSingletonGetter(SecurityKeysBioEnrollProxyImpl); cr.addSingletonGetter(SecurityKeysBioEnrollProxyImpl);
return { return {
SecurityKeysPINBrowserProxy: SecurityKeysPINBrowserProxy, Credential,
SecurityKeysPINBrowserProxyImpl: SecurityKeysPINBrowserProxyImpl, Ctap2Status,
SecurityKeysCredentialBrowserProxy: SecurityKeysCredentialBrowserProxy, Enrollment,
SecurityKeysCredentialBrowserProxyImpl: EnrollmentStatus,
SecurityKeysCredentialBrowserProxyImpl, SecurityKeysBioEnrollProxy,
SecurityKeysResetBrowserProxy: SecurityKeysResetBrowserProxy, SecurityKeysBioEnrollProxyImpl,
SecurityKeysResetBrowserProxyImpl: SecurityKeysResetBrowserProxyImpl, SecurityKeysCredentialBrowserProxy,
SecurityKeysBioEnrollProxy: SecurityKeysBioEnrollProxy, SecurityKeysCredentialBrowserProxyImpl,
SecurityKeysBioEnrollProxyImpl: SecurityKeysBioEnrollProxyImpl, SecurityKeysPINBrowserProxy,
SecurityKeysPINBrowserProxyImpl,
SecurityKeysResetBrowserProxy,
SecurityKeysResetBrowserProxyImpl,
}; };
}); });
...@@ -47,7 +47,7 @@ Polymer({ ...@@ -47,7 +47,7 @@ Polymer({
/** /**
* The list of credentials displayed in the dialog. * The list of credentials displayed in the dialog.
* @private {!Array<!Credential>} * @private {!Array<!settings.Credential>}
*/ */
credentials_: Array, credentials_: Array,
...@@ -125,7 +125,7 @@ Polymer({ ...@@ -125,7 +125,7 @@ Polymer({
/** /**
* @private * @private
* @param {!Array<!Credential>} credentials * @param {!Array<!settings.Credential>} credentials
*/ */
onCredentials_: function(credentials) { onCredentials_: function(credentials) {
if (!credentials.length) { if (!credentials.length) {
...@@ -193,7 +193,7 @@ Polymer({ ...@@ -193,7 +193,7 @@ Polymer({
/** /**
* Stringifies the user entity of a Credential for display in the dialog. * Stringifies the user entity of a Credential for display in the dialog.
* @private * @private
* @param {!Credential} credential * @param {!settings.Credential} credential
* @return {string} * @return {string}
*/ */
formatUser_: function(credential) { formatUser_: function(credential) {
......
...@@ -2,21 +2,19 @@ ...@@ -2,21 +2,19 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
cr.exportPath('settings');
/**
* A data structure used by callers to combine the results of multiple search
* requests.
*
* @typedef {{
* canceled: Boolean,
* didFindMatches: Boolean,
* wasClearSearch: Boolean,
* }}
*/
settings.SearchResult;
cr.define('settings', function() { cr.define('settings', function() {
/**
* A data structure used by callers to combine the results of multiple search
* requests.
*
* @typedef {{
* canceled: Boolean,
* didFindMatches: Boolean,
* wasClearSearch: Boolean,
* }}
*/
let SearchResult;
/** /**
* A CSS attribute indicating that a node should be ignored during searching. * A CSS attribute indicating that a node should be ignored during searching.
* @type {string} * @type {string}
...@@ -621,8 +619,9 @@ cr.define('settings', function() { ...@@ -621,8 +619,9 @@ cr.define('settings', function() {
} }
return { return {
getSearchManager: getSearchManager, getSearchManager,
setSearchManagerForTesting: setSearchManagerForTesting, setSearchManagerForTesting,
SearchRequest: SearchRequest, SearchRequest,
SearchResult,
}; };
}); });
...@@ -912,7 +912,7 @@ suite('SecurityKeysBioEnrollment', function() { ...@@ -912,7 +912,7 @@ suite('SecurityKeysBioEnrollment', function() {
test_util.eventToPromise('bio-enroll-dialog-ready-for-testing', dialog); test_util.eventToPromise('bio-enroll-dialog-ready-for-testing', dialog);
dialog.$.cancelButton.click(); dialog.$.cancelButton.click();
await browserProxy.whenCalled('cancelEnrollment'); await browserProxy.whenCalled('cancelEnrollment');
enrollResolver.resolve({code: Ctap2Status.ERR_KEEPALIVE_CANCEL}); enrollResolver.resolve({code: settings.Ctap2Status.ERR_KEEPALIVE_CANCEL});
await browserProxy.whenCalled('enumerateEnrollments'); await browserProxy.whenCalled('enumerateEnrollments');
await uiReady; await uiReady;
......
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