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

Unified Diff: chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm

Issue 2891883002: Revert of Updates Zoom bubble layout and adds +/- buttons (Closed)
Patch Set: Created 3 years, 7 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
Index: chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm b/chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm
index 96a056e73848f0a1d647ed72bd3e876bc6e5ad75..0b806763daf4cfd16d27d9b6be759bb259cb240a 100644
--- a/chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm
@@ -48,7 +48,7 @@
}
BOOL old_visibility = IsVisible();
- SetVisible(true);
+ SetVisible(ShouldShowDecoration() && !zoom_controller->IsAtDefaultZoom());
base::string16 zoom_percent =
base::FormatPercent(zoom_controller->GetZoomPercent());
@@ -127,10 +127,15 @@
void ZoomDecoration::UpdateUI(zoom::ZoomController* zoom_controller,
NSString* tooltip_string,
bool location_bar_is_dark) {
- vector_icon_ = zoom_controller->GetZoomRelativeToDefault() ==
- zoom::ZoomController::ZOOM_BELOW_DEFAULT_ZOOM
- ? &kZoomMinusIcon
- : &kZoomPlusIcon;
+ vector_icon_ = nullptr;
+ zoom::ZoomController::RelativeZoom relative_zoom =
+ zoom_controller->GetZoomRelativeToDefault();
+ // There is no icon at the default zoom factor.
+ if (relative_zoom == zoom::ZoomController::ZOOM_BELOW_DEFAULT_ZOOM) {
+ vector_icon_ = &kZoomMinusIcon;
+ } else if (relative_zoom == zoom::ZoomController::ZOOM_ABOVE_DEFAULT_ZOOM) {
+ vector_icon_ = &kZoomPlusIcon;
+ }
SetImage(GetMaterialIcon(location_bar_is_dark));

Powered by Google App Engine
This is Rietveld 408576698