diff options
author | wjmaclean <wjmaclean@chromium.org> | 2015-02-20 07:29:52 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-20 15:30:41 +0000 |
commit | bb26a8180d84b8c156005ef515f23f0308e42aae (patch) | |
tree | 8a710d55922c6e40029564fe4faed23e68c5f0ac /components/ui | |
parent | cdc6fb42259bb6364cdf26100947dfccc36a0c4b (diff) | |
download | chromium_src-bb26a8180d84b8c156005ef515f23f0308e42aae.zip chromium_src-bb26a8180d84b8c156005ef515f23f0308e42aae.tar.gz chromium_src-bb26a8180d84b8c156005ef515f23f0308e42aae.tar.bz2 |
ZoomController: manual mode SetZoom() should early-out.
When used in manual mode, SetZoom() should early-out if the new zoom
level is the same as the old one in order to avoid sending unnecessary
ZoomChangedEvents.
BUG=459995
Review URL: https://codereview.chromium.org/942023002
Cr-Commit-Position: refs/heads/master@{#317323}
Diffstat (limited to 'components/ui')
-rw-r--r-- | components/ui/zoom/zoom_controller.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/ui/zoom/zoom_controller.cc b/components/ui/zoom/zoom_controller.cc index 1a68fe4..b471b7e 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; |