| Index: chrome/browser/resources/print_preview/data/app_state.js
|
| diff --git a/chrome/browser/resources/print_preview/data/app_state.js b/chrome/browser/resources/print_preview/data/app_state.js
|
| index 4abb18e97a4ac585547f2e8c45149e6445243a62..1e2b9d50450196243bbdd815f63d1beb0a4d1731 100644
|
| --- a/chrome/browser/resources/print_preview/data/app_state.js
|
| +++ b/chrome/browser/resources/print_preview/data/app_state.js
|
| @@ -131,16 +131,16 @@ cr.define('print_preview', function() {
|
| */
|
| get selectedDestination() {
|
| return (this.state_[AppState.Field.RECENT_DESTINATIONS].length > 0) ?
|
| - this.state_[AppState.Field.RECENT_DESTINATIONS][0] : null;
|
| + this.state_[AppState.Field.RECENT_DESTINATIONS][0] :
|
| + null;
|
| },
|
|
|
| /**
|
| * @return {boolean} Whether the selected destination is valid.
|
| */
|
| isSelectedDestinationValid: function() {
|
| - return this.selectedDestination &&
|
| - this.selectedDestination.id &&
|
| - this.selectedDestination.origin;
|
| + return this.selectedDestination && this.selectedDestination.id &&
|
| + this.selectedDestination.origin;
|
| },
|
|
|
| /**
|
| @@ -172,7 +172,8 @@ cr.define('print_preview', function() {
|
| getField: function(field) {
|
| if (field == AppState.Field.CUSTOM_MARGINS) {
|
| return this.state_[field] ?
|
| - print_preview.Margins.parse(this.state_[field]) : null;
|
| + print_preview.Margins.parse(this.state_[field]) :
|
| + null;
|
| } else {
|
| return this.state_[field];
|
| }
|
| @@ -191,7 +192,7 @@ cr.define('print_preview', function() {
|
| if (state[AppState.Field.VERSION] == AppState.VERSION_) {
|
| this.state_ = state;
|
| }
|
| - } catch(e) {
|
| + } catch (e) {
|
| console.error('Unable to parse state: ' + e);
|
| // Proceed with default state.
|
| }
|
| @@ -203,14 +204,16 @@ cr.define('print_preview', function() {
|
| if (!this.state_[AppState.Field.RECENT_DESTINATIONS]) {
|
| this.state_[AppState.Field.RECENT_DESTINATIONS] = [];
|
| } else if (!(this.state_[AppState.Field.RECENT_DESTINATIONS] instanceof
|
| - Array)) {
|
| + Array)) {
|
| var tmp = this.state_[AppState.Field.RECENT_DESTINATIONS];
|
| this.state_[AppState.Field.RECENT_DESTINATIONS] = [tmp];
|
| - } else if (!this.state_[AppState.Field.RECENT_DESTINATIONS][0] ||
|
| + } else if (
|
| + !this.state_[AppState.Field.RECENT_DESTINATIONS][0] ||
|
| !this.state_[AppState.Field.RECENT_DESTINATIONS][0].id) {
|
| // read in incorrectly
|
| this.state_[AppState.Field.RECENT_DESTINATIONS] = [];
|
| - } else if (this.state_[AppState.Field.RECENT_DESTINATIONS].length >
|
| + } else if (
|
| + this.state_[AppState.Field.RECENT_DESTINATIONS].length >
|
| AppState.NUM_DESTINATIONS_) {
|
| this.state_[AppState.Field.RECENT_DESTINATIONS].length =
|
| AppState.NUM_DESTINATIONS_;
|
| @@ -254,10 +257,12 @@ cr.define('print_preview', function() {
|
| // Determine if this destination is already in the recent destinations,
|
| // and where in the array it is located.
|
| var newDestination = new RecentDestination(dest);
|
| - var indexFound = this.state_[
|
| - AppState.Field.RECENT_DESTINATIONS].findIndex(function(recent) {
|
| - return (newDestination.id == recent.id &&
|
| - newDestination.origin == recent.origin);
|
| + var indexFound =
|
| + this.state_[AppState.Field.RECENT_DESTINATIONS].findIndex(function(
|
| + recent) {
|
| + return (
|
| + newDestination.id == recent.id &&
|
| + newDestination.origin == recent.origin);
|
| });
|
|
|
| // No change
|
| @@ -270,7 +275,7 @@ cr.define('print_preview', function() {
|
| // index n.
|
| if (indexFound == -1 &&
|
| this.state_[AppState.Field.RECENT_DESTINATIONS].length ==
|
| - AppState.NUM_DESTINATIONS_) {
|
| + AppState.NUM_DESTINATIONS_) {
|
| indexFound = AppState.NUM_DESTINATIONS_ - 1;
|
| }
|
| if (indexFound != -1)
|
| @@ -300,12 +305,10 @@ cr.define('print_preview', function() {
|
| * @private
|
| */
|
| persist_: function() {
|
| - chrome.send(AppState.NATIVE_FUNCTION_NAME_,
|
| - [JSON.stringify(this.state_)]);
|
| + chrome.send(
|
| + AppState.NATIVE_FUNCTION_NAME_, [JSON.stringify(this.state_)]);
|
| }
|
| };
|
|
|
| - return {
|
| - AppState: AppState
|
| - };
|
| + return {AppState: AppState};
|
| });
|
|
|