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

Issue 2845593002: Updates Zoom bubble layout and adds +/- buttons (Closed)

Created:
3 years, 7 months ago by varkha
Modified:
3 years, 7 months ago
CC:
chromium-reviews, tfarina, mac-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Updates Zoom bubble layout and adds +/- buttons Adds + and - buttons to the Zoom bubble. Updates layout to only have one row. With this change the zoom icon (ZoomView) in location bar can be shown even at 100% zoom as long as the zoom bubble is also shown (otherwise the bubble loses its anchor when using + / - buttons to go over 100% zoom without closing the bubble. In this scenario a kZoomPlusIcon is used (rather than none). Whenever the zoom bubble gets closed the location bar gets updated to update layout and visibility of the zoom icon. BUG=651641 TEST=no new tests but a few existing tests updated or checked ZoomControllerTest ZoomDecorationTest ZoomControllerBrowserTest PDFExtensionTest.PdfZoomWithoutBubble TBR=phajdan.jr@chromium.org (for a trivial change in chrome/test/base/test_browser_window.h) Review-Url: https://codereview.chromium.org/2845593002 Cr-Original-Commit-Position: refs/heads/master@{#472611} Committed: https://chromium.googlesource.com/chromium/src/+/c4d839e6e1f0963b2760620cb0ed072b802bf225 Review-Url: https://codereview.chromium.org/2845593002 Cr-Commit-Position: refs/heads/master@{#472891} Committed: https://chromium.googlesource.com/chromium/src/+/f6f47b5a77854b023c3ccd6c57d1584051f2280a

Patch Set 1 #

Patch Set 2 : Updates Zoom bubble layout and adds +/- buttons (mac-views - rebased) #

Patch Set 3 : Updates Zoom bubble layout and adds +/- buttons (mac-views) - fixing the non-mac build #

Patch Set 4 : Updates Zoom bubble layout and adds +/- buttons (rebased) #

Patch Set 5 : Updates Zoom bubble layout and adds +/- buttons (vector images) #

Total comments: 18

Patch Set 6 : Updates Zoom bubble layout and adds +/- buttons (comments) #

Total comments: 33

Patch Set 7 : Updates Zoom bubble layout and adds +/- buttons (comments) #

Total comments: 16

Patch Set 8 : Updates Zoom bubble layout and adds +/- buttons (comments) #

Total comments: 10

Patch Set 9 : Updates Zoom bubble layout and adds +/- buttons (layout) #

Patch Set 10 : Keep zoom icon hidden when zoom is 100% #

Patch Set 11 : Always shows zoom icon, even when zoom is 100% #

Patch Set 12 : Always shows zoom icon, even when zoom is 100% (rebased) #

Total comments: 20

Patch Set 13 : Comments and nits #

Patch Set 14 : Hide zoom icon at 100% #

Patch Set 15 : Make a fix for 100% zoom case portable to Mac #

Patch Set 16 : Making tests happy #

Patch Set 17 : Fix ZoomController to never show the bubble when zoom level is not changed from default #

Total comments: 2

Patch Set 18 : Updates Zoom bubble layout and adds +/- buttons (reland) #

Patch Set 19 : Fix compilation error on gcc #

Unified diffs Side-by-side diffs Delta from patch set Stats (+261 lines, -90 lines) Patch
M chrome/app/generated_resources.grd View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 2 chunks +6 lines, -15 lines 0 comments Download
M chrome/app/vector_icons/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -0 lines 0 comments Download
A chrome/app/vector_icons/add.icon View 1 2 3 4 5 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/app/vector_icons/add.1x.icon View 1 2 3 4 5 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/app/vector_icons/remove.icon View 1 2 3 4 5 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/app/vector_icons/remove.1x.icon View 1 2 3 4 5 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/zoom_decoration.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 2 chunks +5 lines, -10 lines 0 comments Download
M chrome/browser/ui/cocoa/location_bar/zoom_decoration_browsertest.mm View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/ui/location_bar/location_bar.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/location_bar/location_bar_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/location_bar/zoom_bubble_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +19 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/location_bar/zoom_bubble_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 11 chunks +153 lines, -52 lines 0 comments Download
M chrome/browser/ui/views/location_bar/zoom_view.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/ui/zoom/zoom_controller_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -5 lines 0 comments Download
M chrome/test/base/test_browser_window.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +1 line, -0 lines 0 comments Download
M components/zoom/zoom_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -2 lines 0 comments Download

Messages

Total messages: 115 (82 generated)
varkha
estade@, can you please take a first look? One thing that can be simplified is ...
3 years, 7 months ago (2017-04-27 09:01:57 UTC) #16
varkha
https://codereview.chromium.org/2845593002/diff/200001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc File chrome/browser/ui/views/location_bar/zoom_bubble_view.cc (right): https://codereview.chromium.org/2845593002/diff/200001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc#newcode154 chrome/browser/ui/views/location_bar/zoom_bubble_view.cc:154: label_->SetText(label_text); Self review: carve out utility UpdateZoomPercent() method and ...
3 years, 7 months ago (2017-04-27 11:42:39 UTC) #19
Evan Stade
lgtm https://codereview.chromium.org/2845593002/diff/200001/chrome/app/vector_icons/BUILD.gn File chrome/app/vector_icons/BUILD.gn (right): https://codereview.chromium.org/2845593002/diff/200001/chrome/app/vector_icons/BUILD.gn#newcode53 chrome/app/vector_icons/BUILD.gn:53: "minus.1x.icon", could you call this zoom_minus and zoom_plus? ...
3 years, 7 months ago (2017-04-27 17:29:39 UTC) #20
varkha
+pkasting@ for OWNERS in c/b/ui/views/ (assume that Evan's comments are addressed, working across time zones). ...
3 years, 7 months ago (2017-04-28 00:15:12 UTC) #22
varkha
https://codereview.chromium.org/2845593002/diff/200001/chrome/app/vector_icons/BUILD.gn File chrome/app/vector_icons/BUILD.gn (right): https://codereview.chromium.org/2845593002/diff/200001/chrome/app/vector_icons/BUILD.gn#newcode53 chrome/app/vector_icons/BUILD.gn:53: "minus.1x.icon", On 2017/04/27 17:29:38, Evan Stade wrote: > could ...
3 years, 7 months ago (2017-04-28 02:06:14 UTC) #24
Peter Kasting
https://codereview.chromium.org/2845593002/diff/220001/chrome/browser/ui/views/harmony/harmony_layout_provider.cc File chrome/browser/ui/views/harmony/harmony_layout_provider.cc (right): https://codereview.chromium.org/2845593002/diff/220001/chrome/browser/ui/views/harmony/harmony_layout_provider.cc#newcode99 chrome/browser/ui/views/harmony/harmony_layout_provider.cc:99: for (int snap_point : {220, 320, 448, 512}) { ...
3 years, 7 months ago (2017-04-28 05:58:48 UTC) #28
varkha
Thanks Peter, will post updates but wanted to answer the questions first. https://codereview.chromium.org/2845593002/diff/220001/chrome/browser/ui/views/harmony/harmony_layout_provider.cc File chrome/browser/ui/views/harmony/harmony_layout_provider.cc ...
3 years, 7 months ago (2017-04-28 06:21:19 UTC) #29
Peter Kasting
https://codereview.chromium.org/2845593002/diff/220001/chrome/browser/ui/views/harmony/harmony_layout_provider.cc File chrome/browser/ui/views/harmony/harmony_layout_provider.cc (right): https://codereview.chromium.org/2845593002/diff/220001/chrome/browser/ui/views/harmony/harmony_layout_provider.cc#newcode99 chrome/browser/ui/views/harmony/harmony_layout_provider.cc:99: for (int snap_point : {220, 320, 448, 512}) { ...
3 years, 7 months ago (2017-04-28 06:47:27 UTC) #30
varkha
https://codereview.chromium.org/2845593002/diff/220001/chrome/browser/ui/views/harmony/harmony_layout_provider.cc File chrome/browser/ui/views/harmony/harmony_layout_provider.cc (right): https://codereview.chromium.org/2845593002/diff/220001/chrome/browser/ui/views/harmony/harmony_layout_provider.cc#newcode99 chrome/browser/ui/views/harmony/harmony_layout_provider.cc:99: for (int snap_point : {220, 320, 448, 512}) { ...
3 years, 7 months ago (2017-05-01 10:12:00 UTC) #32
tapted
https://codereview.chromium.org/2845593002/diff/240001/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/2845593002/diff/240001/chrome/app/generated_resources.grd#newcode5652 chrome/app/generated_resources.grd:5652: Reset to dafault zoom level dafault -> default https://codereview.chromium.org/2845593002/diff/240001/chrome/browser/ui/views/location_bar/location_bar_view.cc ...
3 years, 7 months ago (2017-05-02 01:28:02 UTC) #38
varkha
https://codereview.chromium.org/2845593002/diff/240001/chrome/app/generated_resources.grd File chrome/app/generated_resources.grd (right): https://codereview.chromium.org/2845593002/diff/240001/chrome/app/generated_resources.grd#newcode5652 chrome/app/generated_resources.grd:5652: Reset to dafault zoom level On 2017/05/02 01:28:02, tapted ...
3 years, 7 months ago (2017-05-03 01:50:28 UTC) #41
tapted
https://codereview.chromium.org/2845593002/diff/260001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc File chrome/browser/ui/views/location_bar/zoom_bubble_view.cc (right): https://codereview.chromium.org/2845593002/diff/260001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc#newcode200 chrome/browser/ui/views/location_bar/zoom_bubble_view.cc:200: constexpr gfx::Size kPreferredZoomBubbleSize = gfx::Size(208, 32); update: we chatted ...
3 years, 7 months ago (2017-05-04 00:24:11 UTC) #44
Peter Kasting
I LGTMed tapted's patch to add the "should snap" bit, so if that lands first, ...
3 years, 7 months ago (2017-05-05 23:50:40 UTC) #45
varkha
https://codereview.chromium.org/2845593002/diff/260001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc File chrome/browser/ui/views/location_bar/zoom_bubble_view.cc (right): https://codereview.chromium.org/2845593002/diff/260001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc#newcode200 chrome/browser/ui/views/location_bar/zoom_bubble_view.cc:200: constexpr gfx::Size kPreferredZoomBubbleSize = gfx::Size(208, 32); On 2017/05/04 00:24:11, ...
3 years, 7 months ago (2017-05-15 22:34:42 UTC) #54
Peter Kasting
LGTM with comments https://codereview.chromium.org/2845593002/diff/340001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc File chrome/browser/ui/views/location_bar/zoom_bubble_view.cc (right): https://codereview.chromium.org/2845593002/diff/340001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc#newcode74 chrome/browser/ui/views/location_bar/zoom_bubble_view.cc:74: SetText(base::FormatPercent(web_contents->GetMaximumZoomPercent())); I worry a little about ...
3 years, 7 months ago (2017-05-16 00:14:35 UTC) #55
tapted
lgtm https://codereview.chromium.org/2845593002/diff/340001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc File chrome/browser/ui/views/location_bar/zoom_bubble_view.cc (right): https://codereview.chromium.org/2845593002/diff/340001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc#newcode74 chrome/browser/ui/views/location_bar/zoom_bubble_view.cc:74: SetText(base::FormatPercent(web_contents->GetMaximumZoomPercent())); this should also take a font style ...
3 years, 7 months ago (2017-05-16 06:29:02 UTC) #56
varkha
With this CL the zoom icon in location bar is always shown in views browser. ...
3 years, 7 months ago (2017-05-16 22:53:07 UTC) #59
Evan Stade
On 2017/05/16 22:53:07, varkha wrote: > I think it is much simpler to just always ...
3 years, 7 months ago (2017-05-16 23:00:20 UTC) #60
Evan Stade
On 2017/05/16 23:00:20, Evan Stade wrote: > On 2017/05/16 22:53:07, varkha wrote: > > I ...
3 years, 7 months ago (2017-05-16 23:03:20 UTC) #61
varkha
On 2017/05/16 23:03:20, Evan Stade wrote: > On 2017/05/16 23:00:20, Evan Stade wrote: > > ...
3 years, 7 months ago (2017-05-16 23:37:12 UTC) #62
Evan Stade
On 2017/05/16 23:37:12, varkha wrote: > On 2017/05/16 23:03:20, Evan Stade wrote: > > On ...
3 years, 7 months ago (2017-05-16 23:53:20 UTC) #65
Peter Kasting
I agree with Evan that we shouldn't be showing the zoom icon all the time. ...
3 years, 7 months ago (2017-05-17 00:01:44 UTC) #66
varkha
Thanks, does the last PS make sense for views implementation?
3 years, 7 months ago (2017-05-17 02:50:16 UTC) #68
varkha
And PS 15 should also fix it such that Mac works the same (icon disappears ...
3 years, 7 months ago (2017-05-17 03:59:36 UTC) #72
varkha
+wjmaclean@ for changes in components/zoom/zoom_controller.cc and chrome/browser/ui/zoom/zoom_controller_unittest.cc
3 years, 7 months ago (2017-05-17 17:28:01 UTC) #88
wjmaclean
On 2017/05/17 17:28:01, varkha wrote: > +wjmaclean@ for changes in components/zoom/zoom_controller.cc and > chrome/browser/ui/zoom/zoom_controller_unittest.cc lgtm
3 years, 7 months ago (2017-05-17 17:43:38 UTC) #91
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2845593002/560001
3 years, 7 months ago (2017-05-18 00:11:28 UTC) #97
commit-bot: I haz the power
Committed patchset #17 (id:560001) as https://chromium.googlesource.com/chromium/src/+/c4d839e6e1f0963b2760620cb0ed072b802bf225
3 years, 7 months ago (2017-05-18 00:22:34 UTC) #100
Lei Zhang
https://codereview.chromium.org/2845593002/diff/560001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc File chrome/browser/ui/views/location_bar/zoom_bubble_view.cc (right): https://codereview.chromium.org/2845593002/diff/560001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc#newcode71 chrome/browser/ui/views/location_bar/zoom_bubble_view.cc:71: return button; I think you need to std::move(button). This ...
3 years, 7 months ago (2017-05-18 01:59:28 UTC) #102
Lei Zhang
A revert of this CL (patchset #17 id:560001) has been created in https://codereview.chromium.org/2891883002/ by thestig@chromium.org. ...
3 years, 7 months ago (2017-05-18 02:02:14 UTC) #103
varkha
https://codereview.chromium.org/2845593002/diff/560001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc File chrome/browser/ui/views/location_bar/zoom_bubble_view.cc (right): https://codereview.chromium.org/2845593002/diff/560001/chrome/browser/ui/views/location_bar/zoom_bubble_view.cc#newcode71 chrome/browser/ui/views/location_bar/zoom_bubble_view.cc:71: return button; On 2017/05/18 01:59:28, Lei Zhang wrote: > ...
3 years, 7 months ago (2017-05-18 15:04:25 UTC) #107
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2845593002/600001
3 years, 7 months ago (2017-05-18 18:43:28 UTC) #112
commit-bot: I haz the power
3 years, 7 months ago (2017-05-18 18:55:43 UTC) #115
Message was sent while issue was closed.
Committed patchset #19 (id:600001) as
https://chromium.googlesource.com/chromium/src/+/f6f47b5a77854b023c3ccd6c57d1...

Powered by Google App Engine
This is Rietveld 408576698