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

Unified Diff: chrome/browser/ui/zoom/zoom_controller.cc

Issue 372813003: Show zoom bubble for everything but an empty host. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test expectation. Created 6 years, 5 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.h ('k') | chrome/browser/ui/zoom/zoom_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/zoom/zoom_controller.cc
diff --git a/chrome/browser/ui/zoom/zoom_controller.cc b/chrome/browser/ui/zoom/zoom_controller.cc
index 53def6459835c0c2f1e7e79b9f4221db4216df1f..0e4db31c771ca8a4f0e3a31b87ec5f42376ff495 100644
--- a/chrome/browser/ui/zoom/zoom_controller.cc
+++ b/chrome/browser/ui/zoom/zoom_controller.cc
@@ -258,17 +258,10 @@ void ZoomController::DidNavigateMainFrame(
void ZoomController::OnZoomLevelChanged(
const content::HostZoomMap::ZoomLevelChange& change) {
- UpdateStateIncludingTemporary(
- change.host,
- change.mode == content::HostZoomMap::ZOOM_CHANGED_TEMPORARY_ZOOM);
+ UpdateState(change.host);
}
void ZoomController::UpdateState(const std::string& host) {
- UpdateStateIncludingTemporary(host, false);
-}
-
-void ZoomController::UpdateStateIncludingTemporary(const std::string& host,
- bool is_temporary_zoom) {
// If |host| is empty, all observers should be updated.
if (!host.empty()) {
// Use the navigation entry's URL instead of the WebContents' so virtual
@@ -281,18 +274,16 @@ void ZoomController::UpdateStateIncludingTemporary(const std::string& host,
}
}
- // The zoom bubble can be shown for all normal, per-origin zoom changes
- // (where the host will not be empty and the zoom is not temporary), or any
- // special zoom changes (where the zoom mode will not be "default").
- bool can_show_bubble =
- zoom_mode_ != ZOOM_MODE_DEFAULT || (!host.empty() && !is_temporary_zoom);
+ // The zoom bubble can be shown for all zoom changes where the host is
+ // not empty.
+ bool 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;
+ zoom_change_data.can_show_bubble = can_show_bubble;
FOR_EACH_OBSERVER(
ZoomObserver, observers_, OnZoomChanged(zoom_change_data));
} else {
« no previous file with comments | « chrome/browser/ui/zoom/zoom_controller.h ('k') | chrome/browser/ui/zoom/zoom_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698