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

Issue 1469423002: Modify toolbar action bar layout for material design (Closed)

Created:
5 years ago by tdanderson
Modified:
5 years ago
CC:
chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Modify toolbar action bar layout for material design Modifies the spacing between buttons in the toolbar action bar (extensions) when material design is enabled, and ensures that the area directly to the right of the location bar in LTR can be used to resize the action bar width. BUG=555031, 550816 TEST=manual Committed: https://crrev.com/a1ce3730e40062ab80ec0faf52d6c876186a4c44 Cr-Commit-Position: refs/heads/master@{#364123}

Patch Set 1 #

Total comments: 36

Patch Set 2 : comments addressed #

Patch Set 3 : rebase #

Total comments: 23

Patch Set 4 : more comments addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+99 lines, -104 lines) Patch
M chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm View 1 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/layout_constants.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/ui/toolbar/toolbar_actions_bar.h View 1 2 1 chunk +4 lines, -6 lines 0 comments Download
M chrome/browser/ui/toolbar/toolbar_actions_bar.cc View 1 2 3 10 chunks +21 lines, -28 lines 0 comments Download
M chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc View 1 2 3 2 chunks +12 lines, -11 lines 0 comments Download
M chrome/browser/ui/views/toolbar/browser_actions_container.h View 1 1 chunk +9 lines, -8 lines 0 comments Download
M chrome/browser/ui/views/toolbar/browser_actions_container.cc View 1 2 3 7 chunks +22 lines, -18 lines 0 comments Download
M chrome/browser/ui/views/toolbar/toolbar_view.h View 1 chunk +0 lines, -6 lines 0 comments Download
M chrome/browser/ui/views/toolbar/toolbar_view.cc View 1 2 3 7 chunks +28 lines, -25 lines 0 comments Download

Messages

Total messages: 24 (7 generated)
tdanderson
Devlin and Peter, can you please take a look? https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right): https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc#newcode62 chrome/browser/ui/toolbar/toolbar_actions_bar.cc:62: ...
5 years ago (2015-11-24 19:34:31 UTC) #3
Devlin
leaving toolbar_view.* to Peter. https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right): https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc#newcode62 chrome/browser/ui/toolbar/toolbar_actions_bar.cc:62: int GetRightPadding() { On 2015/11/24 ...
5 years ago (2015-11-24 21:17:11 UTC) #4
Peter Kasting
https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right): https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc#newcode43 chrome/browser/ui/toolbar/toolbar_actions_bar.cc:43: // Matches GetLayoutConstant(TOOLBAR_STANDARD_SPACING). Nuke all these constants and all ...
5 years ago (2015-11-24 23:07:47 UTC) #5
tdanderson
Peter and Devlin, can you please take another look? https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right): https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc#newcode43 chrome/browser/ui/toolbar/toolbar_actions_bar.cc:43: ...
5 years ago (2015-11-26 17:04:02 UTC) #6
Peter Kasting
https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right): https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc#newcode43 chrome/browser/ui/toolbar/toolbar_actions_bar.cc:43: // Matches GetLayoutConstant(TOOLBAR_STANDARD_SPACING). On 2015/11/26 17:04:01, tdanderson wrote: > ...
5 years ago (2015-11-30 23:52:15 UTC) #7
Evan Stade
https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right): https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc#newcode43 chrome/browser/ui/toolbar/toolbar_actions_bar.cc:43: // Matches GetLayoutConstant(TOOLBAR_STANDARD_SPACING). On 2015/11/30 23:52:14, Peter Kasting wrote: ...
5 years ago (2015-12-01 23:00:55 UTC) #9
tdanderson
Peter can you please take another look? https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right): https://codereview.chromium.org/1469423002/diff/1/chrome/browser/ui/toolbar/toolbar_actions_bar.cc#newcode43 chrome/browser/ui/toolbar/toolbar_actions_bar.cc:43: // Matches ...
5 years ago (2015-12-07 16:14:14 UTC) #10
Peter Kasting
LGTM https://codereview.chromium.org/1469423002/diff/40001/chrome/browser/ui/toolbar/toolbar_actions_bar.cc File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right): https://codereview.chromium.org/1469423002/diff/40001/chrome/browser/ui/toolbar/toolbar_actions_bar.cc#newcode41 chrome/browser/ui/toolbar/toolbar_actions_bar.cc:41: // Matches GetLayoutConstant(TOOLBAR_STANDARD_SPACING). While I'm on the hook ...
5 years ago (2015-12-08 21:56:25 UTC) #11
Devlin
lgtm https://codereview.chromium.org/1469423002/diff/40001/chrome/browser/ui/toolbar/toolbar_actions_bar.cc File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right): https://codereview.chromium.org/1469423002/diff/40001/chrome/browser/ui/toolbar/toolbar_actions_bar.cc#newcode213 chrome/browser/ui/toolbar/toolbar_actions_bar.cc:213: const bool display_chevron = nit: IMO, having POD ...
5 years ago (2015-12-08 22:13:44 UTC) #12
Evan Stade
https://codereview.chromium.org/1469423002/diff/40001/chrome/browser/ui/views/toolbar/toolbar_view.cc File chrome/browser/ui/views/toolbar/toolbar_view.cc (right): https://codereview.chromium.org/1469423002/diff/40001/chrome/browser/ui/views/toolbar/toolbar_view.cc#newcode496 chrome/browser/ui/views/toolbar/toolbar_view.cc:496: app_menu_button_->GetPreferredSize().width(); these two functions copy each other a lot. ...
5 years ago (2015-12-09 01:05:10 UTC) #13
tdanderson
https://codereview.chromium.org/1469423002/diff/40001/chrome/browser/ui/toolbar/toolbar_actions_bar.cc File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right): https://codereview.chromium.org/1469423002/diff/40001/chrome/browser/ui/toolbar/toolbar_actions_bar.cc#newcode41 chrome/browser/ui/toolbar/toolbar_actions_bar.cc:41: // Matches GetLayoutConstant(TOOLBAR_STANDARD_SPACING). On 2015/12/08 21:56:24, Peter Kasting wrote: ...
5 years ago (2015-12-09 18:22:59 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1469423002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1469423002/60001
5 years ago (2015-12-09 18:24:26 UTC) #17
Devlin
https://codereview.chromium.org/1469423002/diff/40001/chrome/browser/ui/toolbar/toolbar_actions_bar.cc File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right): https://codereview.chromium.org/1469423002/diff/40001/chrome/browser/ui/toolbar/toolbar_actions_bar.cc#newcode213 chrome/browser/ui/toolbar/toolbar_actions_bar.cc:213: const bool display_chevron = On 2015/12/09 18:22:58, tdanderson wrote: ...
5 years ago (2015-12-09 19:22:28 UTC) #18
Devlin
5 years ago (2015-12-09 19:22:38 UTC) #19
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years ago (2015-12-09 19:23:59 UTC) #21
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/a1ce3730e40062ab80ec0faf52d6c876186a4c44 Cr-Commit-Position: refs/heads/master@{#364123}
5 years ago (2015-12-09 19:24:42 UTC) #23
tdanderson
5 years ago (2015-12-09 19:58:14 UTC) #24
Message was sent while issue was closed.
https://codereview.chromium.org/1469423002/diff/40001/chrome/browser/ui/toolb...
File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right):

https://codereview.chromium.org/1469423002/diff/40001/chrome/browser/ui/toolb...
chrome/browser/ui/toolbar/toolbar_actions_bar.cc:213: const bool display_chevron
=
On 2015/12/09 19:22:27, Devlin wrote:
> On 2015/12/09 18:22:58, tdanderson wrote:
> > On 2015/12/08 22:13:44, Devlin wrote:
> > > nit: IMO, having POD like this be const is overkill, and doesn't really
ever
> > > help much (it just means that when someone does want it to change, they
need
> > to
> > > take it out).  Unless there's reason to do it, I'd just have these stick
as
> > > bool, int.
> > 
> > IMO in general doing this improves readability. When tracing or debugging a
> > method I like knowing upfront which locals can/will change without needing
to
> > scan through the entire body. It also guards against someone else
accidentally
> > or incorrectly mutating a variable that was originally not meant to change.
> And
> > if they do want it to change, IMO the cost of removing 'const' does not
> outweigh
> > the benefit of having it there in the first place.
> > 
> > My preference would be to leave the const in here (and in
> > browser_actions_container.cc). If you still disagree I'm happy to discuss
> > further / change them back in a follow-up CL.
> 
> TL;DR: I'd prefer them removed.
> 
> The chance of someone "accidentally" modifying a POD is pretty slim, I think
> (the reason it's so beneficial for objects is that if I call Foo(), I may not
> know if Foo() has some side-effect - we should know that foo = bar modifies
the
> value of foo :)).  So in my opinion it's just making extra work for someone
else
> down the road, and doesn't really add much in the way of readability.  The
style
> guide also encourages const in three main cases - function arguments by
> reference or ptr, methods, and data members; this doesn't fall into those
> categories.

OK, fair enough. I have removed them in:
https://codereview.chromium.org/1505403003/

Powered by Google App Engine
This is Rietveld 408576698