Index: chrome/browser/resources/pdf/pdf.js |
diff --git a/chrome/browser/resources/pdf/pdf.js b/chrome/browser/resources/pdf/pdf.js |
index c7b172078d7778472af64c4fe851a35bca15b73e..05c717330a00bf0770144ec919c2cb04fb92bbe5 100644 |
--- a/chrome/browser/resources/pdf/pdf.js |
+++ b/chrome/browser/resources/pdf/pdf.js |
@@ -396,6 +396,15 @@ PDFViewer.prototype = { |
if (e.ctrlKey) |
this.rotateCounterClockwise_(); |
return; |
+ case 220: // Backslash key. |
+ if (e.ctrlKey) { |
raymes
2016/08/29 03:35:09
Do you think it might be confusing that this might
Lei Zhang
2016/08/29 05:33:54
Probably. I'll take a closer look tomorrow.
Lei Zhang
2016/09/02 02:17:52
Today is tomorrow somewhere in the world.
|
+ if (this.viewport_.fittingType == Viewport.FittingType.FIT_TO_PAGE) { |
+ this.fitToWidth_(); |
+ } else { |
+ this.fitToPage_(); |
+ } |
+ } |
+ return; |
case 221: // right bracket. |
if (e.ctrlKey) |
this.rotateClockwise_(); |
@@ -442,6 +451,10 @@ PDFViewer.prototype = { |
}); |
}, |
+ /** |
+ * @private |
+ * Set zoom to "fit to page". |
+ */ |
fitToPage_: function() { |
this.viewport_.fitToPage(); |
this.toolbarManager_.forceHideTopToolbar(); |
@@ -449,6 +462,15 @@ PDFViewer.prototype = { |
/** |
* @private |
+ * Set zoom to "fit to width". |
+ */ |
+ fitToWidth_: function() { |
+ this.viewport_.fitToWidth(); |
+ this.toolbarManager_.forceHideTopToolbar(); |
+ }, |
+ |
+ /** |
+ * @private |
* Notify the plugin to print. |
*/ |
print_: function() { |