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

Issue 766263003: [Extension Toolbar] Refactor and finish pop out logic for actions (Closed)

Created:
6 years ago by Devlin
Modified:
5 years ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, tfarina, extensions-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

[Extension Toolbar] Refactor and finish pop out logic for actions * Pull out the logic to "pop out" actions when they want to act into a separate inner class of ToolbarActionsBar. * Make unit tests for ToolbarActionsBar also test the overflow container. * Turn off "popping out" actions by default. UI has decided that, for the time being, we want to hold off on popping out actions. Since this is still in heavy flux, keep it in the code base (and tested) to prevent code rot. BUG=417441 Committed: https://crrev.com/f78536e0daa95933dbd5f4c868b201356dfcdf9b Cr-Commit-Position: refs/heads/master@{#308638}

Patch Set 1 : #

Total comments: 4

Patch Set 2 : #

Patch Set 3 : #

Total comments: 8

Patch Set 4 : Avi's #

Patch Set 5 : Latest master #

Total comments: 5

Patch Set 6 : Sky's + OWNERS #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+666 lines, -309 lines) Patch
M chrome/browser/ui/cocoa/extensions/browser_actions_controller.h View 1 2 3 4 5 1 chunk +5 lines, -2 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/browser_actions_controller.mm View 1 2 3 4 5 3 chunks +30 lines, -23 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/test_toolbar_actions_bar_helper_cocoa.mm View 3 chunks +12 lines, -5 lines 0 comments Download
M chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.mm View 1 2 chunks +13 lines, -1 line 0 comments Download
A chrome/browser/ui/toolbar/OWNERS View 1 2 3 4 5 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/ui/toolbar/test_toolbar_actions_bar_helper.h View 1 chunk +5 lines, -1 line 0 comments Download
M chrome/browser/ui/toolbar/toolbar_actions_bar.h View 1 2 3 4 5 10 chunks +34 lines, -26 lines 0 comments Download
M chrome/browser/ui/toolbar/toolbar_actions_bar.cc View 1 2 3 4 5 14 chunks +396 lines, -170 lines 11 comments Download
M chrome/browser/ui/toolbar/toolbar_actions_bar_unittest.cc View 1 2 3 4 5 9 chunks +139 lines, -72 lines 0 comments Download
A chrome/browser/ui/views/toolbar/OWNERS View 1 2 3 4 5 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/toolbar/browser_actions_container.cc View 1 2 3 4 1 chunk +5 lines, -3 lines 0 comments Download
M chrome/browser/ui/views/toolbar/test_toolbar_actions_bar_helper_views.cc View 3 chunks +12 lines, -5 lines 0 comments Download

Messages

Total messages: 40 (20 generated)
Devlin
Hey Finnur - in true Google fashion, it looks like right when I finished coding ...
6 years ago (2014-12-12 07:03:26 UTC) #15
Finnur
Oh, man. I sympathize. :( My brain is a bit fried after a long week ...
6 years ago (2014-12-12 15:06:07 UTC) #16
Devlin
https://codereview.chromium.org/766263003/diff/260001/chrome/browser/ui/toolbar/toolbar_actions_bar.cc File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right): https://codereview.chromium.org/766263003/diff/260001/chrome/browser/ui/toolbar/toolbar_actions_bar.cc#newcode80 chrome/browser/ui/toolbar/toolbar_actions_bar.cc:80: // Find where the correct index (it's guaranteed to ...
6 years ago (2014-12-12 18:27:07 UTC) #17
Devlin
+Avi for cocoa, Scott for ui/views and ui/toolbar. Cheers!
6 years ago (2014-12-12 22:07:18 UTC) #20
Avi (use Gerrit)
https://codereview.chromium.org/766263003/diff/320001/chrome/browser/ui/cocoa/extensions/browser_actions_controller.h File chrome/browser/ui/cocoa/extensions/browser_actions_controller.h (right): https://codereview.chromium.org/766263003/diff/320001/chrome/browser/ui/cocoa/extensions/browser_actions_controller.h#newcode71 chrome/browser/ui/cocoa/extensions/browser_actions_controller.h:71: mainController:(BrowserActionsController*)mainController; Document that parameter. "If this controller is for ...
6 years ago (2014-12-12 23:53:59 UTC) #21
Devlin
https://codereview.chromium.org/766263003/diff/320001/chrome/browser/ui/cocoa/extensions/browser_actions_controller.h File chrome/browser/ui/cocoa/extensions/browser_actions_controller.h (right): https://codereview.chromium.org/766263003/diff/320001/chrome/browser/ui/cocoa/extensions/browser_actions_controller.h#newcode71 chrome/browser/ui/cocoa/extensions/browser_actions_controller.h:71: mainController:(BrowserActionsController*)mainController; On 2014/12/12 23:53:59, Avi wrote: > Document that ...
6 years ago (2014-12-13 00:18:18 UTC) #23
Avi (use Gerrit)
lgtm Gotcha.
6 years ago (2014-12-13 03:37:54 UTC) #24
Devlin
Scott, friendly ping. :)
6 years ago (2014-12-15 23:24:34 UTC) #26
sky
I started looking at this and came to the conclusion you and Finnr should be ...
6 years ago (2014-12-16 00:53:46 UTC) #27
Devlin
(Responding to questions; no patch change yet) On 2014/12/16 00:53:46, sky wrote: > I started ...
6 years ago (2014-12-16 01:01:19 UTC) #28
sky
On 2014/12/16 01:01:19, Devlin wrote: > (Responding to questions; no patch change yet) > > ...
6 years ago (2014-12-16 01:07:09 UTC) #29
Finnur
> I started looking at this and came to the conclusion you and Finnr should ...
6 years ago (2014-12-16 10:56:01 UTC) #30
Devlin
OWNERS format look okay, Scott? On 2014/12/16 10:56:01, Finnur wrote: > Yeah, sure. I guess ...
6 years ago (2014-12-16 17:04:22 UTC) #31
sky
Yes, LGTM - thanks!
6 years ago (2014-12-16 17:06:55 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/766263003/420001
6 years ago (2014-12-16 17:17:37 UTC) #34
commit-bot: I haz the power
Committed patchset #6 (id:420001)
6 years ago (2014-12-16 19:44:49 UTC) #35
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/f78536e0daa95933dbd5f4c868b201356dfcdf9b Cr-Commit-Position: refs/heads/master@{#308638}
6 years ago (2014-12-16 19:45:40 UTC) #36
Thiemo Nagel
Hi Devlin, while looking into a crash in ToolbarActionsBar::ReorderActions() (cf. https://crbug.com/563557) I've come across the ...
5 years ago (2015-11-30 16:52:17 UTC) #38
Devlin
TL;DR: The at()s should be updated. The real bug is a corner case that would ...
5 years ago (2015-11-30 17:07:03 UTC) #39
Thiemo Nagel
5 years ago (2015-11-30 17:35:42 UTC) #40
Message was sent while issue was closed.
> TL;DR: The at()s should be updated.

Awesome, thanks for the quick reply!  Would you mind adding me to that CL so
that we can continue the discussion there?

I think it would be great if the assumptions that are being made about |to_sort|
and |reference| could be documented at the top of SortContainer() and also
whether the code will crash or whether it will result in undefined behaviour if
the assumptions are violated.  (In my opinion both could be valid as long as the
caller's expectations are managed accordingly.)

https://codereview.chromium.org/766263003/diff/420001/chrome/browser/ui/toolb...
File chrome/browser/ui/toolbar/toolbar_actions_bar.cc (right):

https://codereview.chromium.org/766263003/diff/420001/chrome/browser/ui/toolb...
chrome/browser/ui/toolbar/toolbar_actions_bar.cc:85: for (size_t i = 0; i <
reference.size() - 1; ++i) {
> If every element up to the last one is in the proper place, the last once
cannot
> be out of place (where else would it go?).  We also use j = i+1, which will
blow
> up if i == reference.size().

Thank you, now I see.  That might be worth a comment.  ;)

https://codereview.chromium.org/766263003/diff/420001/chrome/browser/ui/toolb...
chrome/browser/ui/toolbar/toolbar_actions_bar.cc:90: while
(!equal(to_sort->at(j), reference[i])) {
On 2015/11/30 17:07:03, Devlin wrote:
> well, in theory, the at() is guaranteed to be safe because of the DCHECK on
line
> 79

Yes, in combination with that on line 92.

Powered by Google App Engine
This is Rietveld 408576698