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

Issue 148143004: Add notification mechanism when BrowserActionButton's icon has been updated. (Closed)

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

Description

Add notification mechanism when BrowserActionButton's icon has been updated. In the browser actions container's chevron menu, a MenuItemView's icon comes from BrowserActionView::GetIconWithBadge() (which comes from BrowserActionButton's icon) when the MenuItemView is created. But, BrowserActionButton's icon may be not yet loaded in that timing because it is read from filesystem in another thread. To solve this issue, we design an icon state observer in BrowserActionButton, a lifecycle observer in MenuItemView. A helper class whose instance binds to MenuItemView's lifecycle and listens to button's icon state, refresh the host menu item's icon when the button's icon was updated. R=finnur@chromium.org BUG=319619 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=253406

Patch Set 1 #

Total comments: 16

Patch Set 2 #

Total comments: 5

Patch Set 3 : #

Total comments: 2

Patch Set 4 : #

Total comments: 2

Patch Set 5 : #

Total comments: 4

Patch Set 6 : #

Total comments: 4

Patch Set 7 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -12 lines) Patch
M AUTHORS View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.h View 1 2 3 4 5 6 3 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc View 1 2 3 4 5 6 3 chunks +40 lines, -1 line 0 comments Download
M chrome/browser/ui/views/toolbar/browser_action_view.h View 1 2 3 4 5 6 4 chunks +21 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/toolbar/browser_action_view.cc View 1 2 4 chunks +14 lines, -11 lines 0 comments Download

Messages

Total messages: 37 (0 generated)
leiyi.jp
6 years, 10 months ago (2014-02-08 09:58:45 UTC) #1
leiyi.jp
The CQ bit was checked by leiyi.jp@gmail.com
6 years, 10 months ago (2014-02-10 01:53:22 UTC) #2
leiyi.jp
The CQ bit was unchecked by leiyi.jp@gmail.com
6 years, 10 months ago (2014-02-10 01:53:23 UTC) #3
Finnur
Thank you for uploading. I have a few comments, mostly just nits, as I like ...
6 years, 10 months ago (2014-02-10 10:41:40 UTC) #4
Finnur
https://codereview.chromium.org/148143004/diff/1/chrome/browser/ui/views/toolbar/browser_action_view.cc File chrome/browser/ui/views/toolbar/browser_action_view.cc (right): https://codereview.chromium.org/148143004/diff/1/chrome/browser/ui/views/toolbar/browser_action_view.cc#newcode118 chrome/browser/ui/views/toolbar/browser_action_view.cc:118: icon_observer_(NULL), Move this line down one to avoid compile ...
6 years, 10 months ago (2014-02-10 11:20:56 UTC) #5
leiyi.jp
All done. Please check again.
6 years, 10 months ago (2014-02-11 23:58:13 UTC) #6
Finnur
https://codereview.chromium.org/148143004/diff/1/ui/views/controls/menu/menu_item_view.cc File ui/views/controls/menu/menu_item_view.cc (right): https://codereview.chromium.org/148143004/diff/1/ui/views/controls/menu/menu_item_view.cc#newcode647 ui/views/controls/menu/menu_item_view.cc:647: lifecycle_observer_ = NULL; Hmmm... Now that I look at ...
6 years, 10 months ago (2014-02-12 11:19:52 UTC) #7
leiyi.jp
Sorry to have so many problems after I adjusted the codes. Please take a look ...
6 years, 10 months ago (2014-02-13 03:39:15 UTC) #8
Finnur
> Sorry to have so many problems after I adjusted the codes No need to ...
6 years, 10 months ago (2014-02-13 10:19:43 UTC) #9
leiyi.jp
On 2014/02/13 10:19:43, Finnur wrote: > > Sorry to have so many problems after I ...
6 years, 10 months ago (2014-02-13 10:38:08 UTC) #10
sky
https://codereview.chromium.org/148143004/diff/350001/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc File chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc (right): https://codereview.chromium.org/148143004/diff/350001/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc#newcode27 chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc:27: // BrowserActionButton's icon may be not yet loaded in ...
6 years, 10 months ago (2014-02-18 16:03:50 UTC) #11
leiyi.jp
On 2014/02/18 16:03:50, sky wrote: > https://codereview.chromium.org/148143004/diff/350001/ui/views/controls/menu/menu_item_view.h#newcode66 > ui/views/controls/menu/menu_item_view.h:66: class LifecycleObserver { > I don't ...
6 years, 10 months ago (2014-02-19 04:36:27 UTC) #12
Finnur
Looks like we are heading in the right direction. I have just a few nits. ...
6 years, 10 months ago (2014-02-19 11:46:30 UTC) #13
sky
https://chromiumcodereview.appspot.com/148143004/diff/460001/ui/views/controls/menu/menu_item_view.cc File ui/views/controls/menu/menu_item_view.cc (right): https://chromiumcodereview.appspot.com/148143004/diff/460001/ui/views/controls/menu/menu_item_view.cc#newcode564 ui/views/controls/menu/menu_item_view.cc:564: // Note: This class also has a public constructor ...
6 years, 10 months ago (2014-02-19 15:01:19 UTC) #14
leiyi.jp
Done. Thanks.
6 years, 10 months ago (2014-02-20 02:49:48 UTC) #15
Finnur
> These comments aren't helpful, nuke them. Well, if you look at the history of ...
6 years, 10 months ago (2014-02-20 11:38:32 UTC) #16
sky
Ugh! Multiple constructors can be a pain, eh? Seems like we should try and make ...
6 years, 10 months ago (2014-02-20 15:59:52 UTC) #17
leiyi.jp
On 2014/02/20 15:59:52, sky wrote: > Ugh! Multiple constructors can be a pain, eh? Seems ...
6 years, 10 months ago (2014-02-21 02:41:01 UTC) #18
sky
Lets change MenuItemView separately, so don't both touching it in this patch. On Thu, Feb ...
6 years, 10 months ago (2014-02-21 16:28:41 UTC) #19
leiyi.jp
On 2014/02/21 16:28:41, sky wrote: > Lets change MenuItemView separately, so don't both touching it ...
6 years, 10 months ago (2014-02-24 01:33:29 UTC) #20
Finnur
Nope. Looks like you just need an OWNERS approval from sky@.
6 years, 10 months ago (2014-02-24 12:58:30 UTC) #21
sky
https://chromiumcodereview.appspot.com/148143004/diff/560001/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc File chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc (right): https://chromiumcodereview.appspot.com/148143004/diff/560001/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc#newcode49 chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc:49: private: nit: newline 48/49. https://chromiumcodereview.appspot.com/148143004/diff/560001/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc#newcode53 chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc:53: // The button ...
6 years, 10 months ago (2014-02-24 16:34:17 UTC) #22
leiyi.jp
On 2014/02/24 16:34:17, sky wrote: > https://chromiumcodereview.appspot.com/148143004/diff/560001/chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc#newcode49 > chrome/browser/ui/views/extensions/browser_action_overflow_menu_controller.cc:49: > private: > nit: newline 48/49. ...
6 years, 10 months ago (2014-02-25 03:03:36 UTC) #23
sky
LGTM
6 years, 10 months ago (2014-02-25 15:52:04 UTC) #24
leiyi.jp
The CQ bit was checked by leiyi.jp@gmail.com
6 years, 10 months ago (2014-02-25 19:16:02 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leiyi.jp@gmail.com/148143004/690001
6 years, 10 months ago (2014-02-25 19:19:56 UTC) #26
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-25 21:05:33 UTC) #27
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=269919
6 years, 10 months ago (2014-02-25 21:05:33 UTC) #28
leiyi.jp
The CQ bit was checked by leiyi.jp@gmail.com
6 years, 10 months ago (2014-02-25 23:09:48 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leiyi.jp@gmail.com/148143004/690001
6 years, 10 months ago (2014-02-25 23:40:20 UTC) #30
Paweł Hajdan Jr.
The CQ bit was unchecked by phajdan.jr@chromium.org
6 years, 10 months ago (2014-02-26 05:45:12 UTC) #31
leiyi.jp
The CQ bit was checked by leiyi.jp@gmail.com
6 years, 10 months ago (2014-02-26 05:56:54 UTC) #32
Paweł Hajdan Jr.
The CQ bit was checked by phajdan.jr@chromium.org
6 years, 10 months ago (2014-02-26 06:01:11 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leiyi.jp@gmail.com/148143004/690001
6 years, 10 months ago (2014-02-26 06:13:27 UTC) #34
leiyi.jp
The CQ bit was unchecked by leiyi.jp@gmail.com
6 years, 10 months ago (2014-02-26 08:00:54 UTC) #35
leiyi.jp
The CQ bit was checked by leiyi.jp@gmail.com
6 years, 10 months ago (2014-02-26 08:01:06 UTC) #36
commit-bot: I haz the power
6 years, 10 months ago (2014-02-26 11:36:00 UTC) #37
Message was sent while issue was closed.
Change committed as 253406

Powered by Google App Engine
This is Rietveld 408576698