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

Unified Diff: components/ui/zoom/zoom_controller.cc

Issue 942023002: ZoomController: manual mode SetZoom() should early-out. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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: components/ui/zoom/zoom_controller.cc
diff --git a/components/ui/zoom/zoom_controller.cc b/components/ui/zoom/zoom_controller.cc
index 1a68fe4434d5196f7683b80442a9403b98f9719f..b471b7e5bf865c013a4ffaf1cadec60c2b5ab639 100644
--- a/components/ui/zoom/zoom_controller.cc
+++ b/components/ui/zoom/zoom_controller.cc
@@ -95,6 +95,10 @@ bool ZoomController::SetZoomLevelByClient(
// Do not actually rescale the page in manual mode.
if (zoom_mode_ == ZOOM_MODE_MANUAL) {
+ // If the zoom level hasn't changed, early out to avoid sending an event.
+ if (zoom_level_ == zoom_level)
+ return true;
+
double old_zoom_level = zoom_level_;
zoom_level_ = zoom_level;
« 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