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

Unified Diff: pdf/instance.cc

Issue 573523002: PDF Viewer - PageUp/Down don't move pdf by page size in FitToPage mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/instance.cc
diff --git a/pdf/instance.cc b/pdf/instance.cc
index 8ec4a9e7e365c4243da41af98ee536c936c7ec83..4bd2f787dfec69d80534de5f9686dc5e619f32b9 100644
--- a/pdf/instance.cc
+++ b/pdf/instance.cc
@@ -779,6 +779,14 @@ void Instance::StopFind() {
void Instance::Zoom(double scale, bool text_only) {
UserMetricsRecordAction("PDF.ZoomFromBrowser");
+
+ // If the zoom level doesn't change it means that this zoom change might have
+ // been initiated by the plugin. In that case, we don't want to change the
+ // zoom mode to ZOOM_SCALE as it may have been intentionally set to
+ // ZOOM_FIT_TO_PAGE or some other value when the zoom was last changed.
+ if (scale == zoom_)
+ return;
+
SetZoom(ZOOM_SCALE, scale);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698