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

Unified Diff: chrome/browser/resources/print_preview/data/app_state.js

Issue 233623003: Remember and restore the account last used destination is registered for. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adjust PrintPreview unit test. Created 6 years, 8 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/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 d706c7440367db58168ddf346e3d74449fc50032..360b77124bd49c97289b3155a44b8fe293b4b9b4 100644
--- a/chrome/browser/resources/print_preview/data/app_state.js
+++ b/chrome/browser/resources/print_preview/data/app_state.js
@@ -35,6 +35,7 @@ cr.define('print_preview', function() {
AppState.Field = {
VERSION: 'version',
SELECTED_DESTINATION_ID: 'selectedDestinationId',
+ SELECTED_DESTINATION_ACCOUNT: 'selectedDestinationAccount',
SELECTED_DESTINATION_ORIGIN: 'selectedDestinationOrigin',
SELECTED_DESTINATION_CAPABILITIES: 'selectedDestinationCapabilities',
SELECTED_DESTINATION_NAME: 'selectedDestinationName',
@@ -72,6 +73,11 @@ cr.define('print_preview', function() {
return this.state_[AppState.Field.SELECTED_DESTINATION_ID];
},
+ /** @return {?string} Account the selected destination is registered for. */
+ get selectedDestinationAccount() {
+ return this.state_[AppState.Field.SELECTED_DESTINATION_ACCOUNT];
+ },
+
/** @return {?string} Origin of the selected destination. */
get selectedDestinationOrigin() {
return this.state_[AppState.Field.SELECTED_DESTINATION_ORIGIN];
@@ -175,6 +181,7 @@ cr.define('print_preview', function() {
if (!this.isInitialized_)
return;
this.state_[AppState.Field.SELECTED_DESTINATION_ID] = dest.id;
+ this.state_[AppState.Field.SELECTED_DESTINATION_ACCOUNT] = dest.account;
this.state_[AppState.Field.SELECTED_DESTINATION_ORIGIN] = dest.origin;
this.state_[AppState.Field.SELECTED_DESTINATION_CAPABILITIES] =
dest.capabilities;

Powered by Google App Engine
This is Rietveld 408576698