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

Unified Diff: chrome/browser/resources/print_preview/settings/more_settings.js

Issue 2865633004: Fix all remaining print preview closure compiler errors (Closed)
Patch Set: Fix onkeydown function Created 3 years, 7 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/resources/print_preview/settings/more_settings.js
diff --git a/chrome/browser/resources/print_preview/settings/more_settings.js b/chrome/browser/resources/print_preview/settings/more_settings.js
index 260cc1b3011fe0a172b8cb58169ac6437c2d80a4..d23c24950c43ba4a978d523c07343e18e760809f 100644
--- a/chrome/browser/resources/print_preview/settings/more_settings.js
+++ b/chrome/browser/resources/print_preview/settings/more_settings.js
@@ -2,9 +2,22 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+cr.exportPath('print_preview');
+
+/**
+ * Which settings are visible to the user.
+ * @enum {number}
+ */
+print_preview.MoreSettingsSettingsToShow = {
+ MOST_POPULAR: 1,
+ ALL: 2
+};
+
cr.define('print_preview', function() {
'use strict';
+ var SettingsToShow = print_preview.MoreSettingsSettingsToShow;
+
/**
* Toggles visibility of the specified printing options sections.
* @param {!print_preview.DestinationStore} destinationStore To listen for
@@ -23,8 +36,8 @@ cr.define('print_preview', function() {
/** @private {!Array<print_preview.SettingsSection>} */
this.settingsSections_ = settingsSections;
- /** @private {MoreSettings.SettingsToShow} */
- this.settingsToShow_ = MoreSettings.SettingsToShow.MOST_POPULAR;
+ /** @private {print_preview.MoreSettingsSettingsToShow} */
+ this.settingsToShow_ = SettingsToShow.MOST_POPULAR;
/** @private {boolean} */
this.capabilitiesReady_ = false;
@@ -39,21 +52,12 @@ cr.define('print_preview', function() {
this.metrics_ = new print_preview.PrintSettingsUiMetricsContext();
}
- /**
- * Which settings are visible to the user.
- * @enum {number}
- */
- MoreSettings.SettingsToShow = {
- MOST_POPULAR: 1,
- ALL: 2
- };
-
MoreSettings.prototype = {
__proto__: print_preview.Component.prototype,
/** @return {boolean} Returns {@code true} if settings are expanded. */
get isExpanded() {
- return this.settingsToShow_ == MoreSettings.SettingsToShow.ALL;
+ return this.settingsToShow_ == SettingsToShow.ALL;
},
/** @override */
@@ -87,9 +91,9 @@ cr.define('print_preview', function() {
*/
onClick_: function() {
this.settingsToShow_ =
- this.settingsToShow_ == MoreSettings.SettingsToShow.MOST_POPULAR ?
- MoreSettings.SettingsToShow.ALL :
- MoreSettings.SettingsToShow.MOST_POPULAR;
+ this.settingsToShow_ == SettingsToShow.MOST_POPULAR ?
+ SettingsToShow.ALL :
+ SettingsToShow.MOST_POPULAR;
this.updateState_(false);
this.metrics_.record(this.isExpanded ?
print_preview.Metrics.PrintSettingsUiBucket.MORE_SETTINGS_CLICKED :
@@ -131,7 +135,7 @@ cr.define('print_preview', function() {
if (!this.capabilitiesReady_)
return;
- var all = this.settingsToShow_ == MoreSettings.SettingsToShow.ALL;
+ var all = this.settingsToShow_ == SettingsToShow.ALL;
this.getChildElement('.more-settings-label').textContent =
loadTimeData.getString(all ? 'lessOptionsLabel' : 'moreOptionsLabel');
var iconEl = this.getChildElement('.more-settings-icon');
@@ -157,7 +161,7 @@ cr.define('print_preview', function() {
fadeOutElement(this.getElement());
var collapseContent =
- this.settingsToShow_ == MoreSettings.SettingsToShow.MOST_POPULAR &&
+ this.settingsToShow_ == SettingsToShow.MOST_POPULAR &&
hasSectionsToToggle;
this.settingsSections_.forEach(function(section) {
section.setCollapseContent(collapseContent, noAnimation);

Powered by Google App Engine
This is Rietveld 408576698