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

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

Issue 2885363003: Add policy to use system default printer (Closed)
Patch Set: Remove IOS checks Created 3 years, 6 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
« no previous file with comments | « chrome/browser/prefs/chrome_command_line_pref_store.cc ('k') | chrome/browser/ui/browser_ui_prefs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/print_preview/data/destination_store.js
diff --git a/chrome/browser/resources/print_preview/data/destination_store.js b/chrome/browser/resources/print_preview/data/destination_store.js
index dd5027e7acb91d0f874058f504516530cbe98794..2e81da63c0880811439eafa8ba37e9f510a3cdf4 100644
--- a/chrome/browser/resources/print_preview/data/destination_store.js
+++ b/chrome/browser/resources/print_preview/data/destination_store.js
@@ -169,6 +169,14 @@ cr.define('print_preview', function() {
print_preview.DestinationOrigin.CROS :
print_preview.DestinationOrigin.LOCAL;
+ /**
+ * Whether to default to the system default printer instead of the most
+ * recent destination.
+ * @private {boolean}
+ */
+ this.useSystemDefaultAsDefault_ =
+ loadTimeData.getBoolean('useSystemDefaultPrinter');
+
this.addEventListeners_();
this.reset_();
}
@@ -597,18 +605,19 @@ cr.define('print_preview', function() {
var candidate = this.destinationMap_[this.getDestinationKey_(
origin, id, account)];
if (candidate != null) {
- if (!foundDestination)
+ if (!foundDestination && !this.useSystemDefaultAsDefault_)
this.selectDestination(candidate);
candidate.isRecent = true;
foundDestination = true;
- } else if (!foundDestination) {
+ } else if (!foundDestination && !this.useSystemDefaultAsDefault_) {
foundDestination = this.fetchPreselectedDestination_(
origin, id, account, name, capabilities, extensionId,
extensionName);
}
}
}
- if (foundDestination)
+
+ if (foundDestination && !this.useSystemDefaultAsDefault_)
return;
// Try the system default
« no previous file with comments | « chrome/browser/prefs/chrome_command_line_pref_store.cc ('k') | chrome/browser/ui/browser_ui_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698