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

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

Issue 335583004: Added a test that currently is able to print to pdf. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed how the test saved the pdf Created 6 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
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.

Powered by Google App Engine
This is Rietveld 408576698