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..179f9233a9965a78d8e9449ed2fedd4e8ccbddc4 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.CLICK_STUFF, |
+ this.onClickStuff_.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')); |
}, |
+ onClickStuff_: function() { |
Lei Zhang
2014/06/16 23:12:40
Are you going to expand this function to have para
ivandavid
2014/06/17 00:38:56
I am going to expand this function to take argumen
Lei Zhang
2014/06/17 00:53:26
If you can continue working on this CL and do this
ivandavid
2014/06/17 21:38:18
Done.
|
+ 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. |