Index: chrome/browser/resources/print_preview/print_preview.js |
diff --git a/chrome/browser/resources/print_preview/print_preview.js b/chrome/browser/resources/print_preview/print_preview.js |
index ac3a0ab789135db2746d6fe3b522398b759867d9..70bfeaf241abaf8b9b82091cd018b1219169586a 100644 |
--- a/chrome/browser/resources/print_preview/print_preview.js |
+++ b/chrome/browser/resources/print_preview/print_preview.js |
@@ -285,7 +285,10 @@ cr.define('print_preview', function() { |
this.nativeLayer_, |
print_preview.NativeLayer.EventType.PRIVET_PRINT_FAILED, |
this.onPrivetPrintFailed_.bind(this)); |
- |
+ this.tracker.add( |
+ this.nativeLayer_, |
+ print_preview.NativeLayer.EventType.MANIPULATE_SETTINGS, |
+ this.onManipulateSettings_.bind(this)); |
this.tracker.add( |
$('system-dialog-link'), |
@@ -691,6 +694,7 @@ cr.define('print_preview', function() { |
onPreviewGenerationDone_: function() { |
this.isPreviewGenerationInProgress_ = false; |
this.printHeader_.isPrintButtonEnabled = true; |
+ chrome.send('UILoaded'); |
this.printIfReady_(); |
}, |
@@ -889,6 +893,16 @@ cr.define('print_preview', function() { |
localStrings.getString('couldNotPrint')); |
}, |
+ onManipulateSettings_: function() { |
+ var settings = $('layout-settings'); |
+ this.destinationStore_.selectDefaultDestination_(); |
+ var portrait = document.getElementsByClassName( |
+ 'layout-settings-landscape-radio')[0]; |
+ if (portrait) { |
+ portrait.click(); |
+ } |
+ }, |
+ |
/** |
* Called when the open-cloud-print-dialog link is clicked. Opens the Google |
* Cloud Print web dialog. |