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

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

Issue 940673002: No need to suppress ZoomBubble if !window_->IsActive(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-remove stale comment. 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 | « chrome/browser/ui/zoom/zoom_controller_browsertest.cc ('k') | 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 b471b7e5bf865c013a4ffaf1cadec60c2b5ab639..6df05d9e78c6abe316c6203a419f7a4e2b6acdc7 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));
}
« no previous file with comments | « chrome/browser/ui/zoom/zoom_controller_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698