diff options
author | wjmaclean <wjmaclean@chromium.org> | 2015-02-25 11:38:36 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-25 19:39:35 +0000 |
commit | ff3d0f6b28841ec02c2d3555ce0d819fc18fa585 (patch) | |
tree | 1e18b0a48f3edd4b467e1eab41a79acd96f32b76 /components/ui | |
parent | a9d947d2cb78c4485092a55c255d459fc8e97d94 (diff) | |
download | chromium_src-ff3d0f6b28841ec02c2d3555ce0d819fc18fa585.zip chromium_src-ff3d0f6b28841ec02c2d3555ce0d819fc18fa585.tar.gz chromium_src-ff3d0f6b28841ec02c2d3555ce0d819fc18fa585.tar.bz2 |
No need to suppress ZoomBubble if !window_->IsActive().
In Browser::OnZoomChanged() we currently filter on both (1) the event
having been generated by the active webcontents, and (2) the browser
window being active.
However, the window can receive <ctrl>-<scrollwheel> events even when
it is not active, and these will result in zoom changing without a zoom
bubble being shown.
This CL removes the check for window_->IsActive() so that the zoom
bubble always shows if the zoom changes for the active web contents by
a means other than the wrench menu.
TEST= Open chrome, make window inactive, hover over window and zoom
with the mouse scroll-wheel; the zoom bubble should appear.
BUG=459322
Review URL: https://codereview.chromium.org/940673002
Cr-Commit-Position: refs/heads/master@{#318089}
Diffstat (limited to 'components/ui')
-rw-r--r-- | components/ui/zoom/zoom_controller.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/ui/zoom/zoom_controller.cc b/components/ui/zoom/zoom_controller.cc index b471b7e..6df05d9 100644 --- a/components/ui/zoom/zoom_controller.cc +++ b/components/ui/zoom/zoom_controller.cc @@ -318,24 +318,24 @@ void ZoomController::UpdateState(const std::string& host) { } } - // The zoom bubble should not be shown for zoom changes where the host is - // empty. - bool can_show_bubble = can_show_bubble_ && !host.empty(); - if (event_data_) { // For state changes initiated within the ZoomController, information about // the change should be sent. ZoomChangedEventData zoom_change_data = *event_data_; event_data_.reset(); - zoom_change_data.can_show_bubble = can_show_bubble; + // The zoom bubble should not be shown for zoom changes where the host + // is empty. + zoom_change_data.can_show_bubble = can_show_bubble_ && !host.empty(); FOR_EACH_OBSERVER(ZoomObserver, observers_, OnZoomChanged(zoom_change_data)); } else { // TODO(wjmaclean) Should we consider having HostZoomMap send both old and // new zoom levels here? double zoom_level = GetZoomLevel(); - ZoomChangedEventData zoom_change_data( - web_contents(), zoom_level, zoom_level, zoom_mode_, can_show_bubble); + // We never show a zoom bubble for an event we didn't generate. + ZoomChangedEventData zoom_change_data(web_contents(), zoom_level, + zoom_level, zoom_mode_, + false /* can_show_bubble */); FOR_EACH_OBSERVER(ZoomObserver, observers_, OnZoomChanged(zoom_change_data)); } |