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

Issue 11415014: Stop using shell::GetInstance()->system_tray() in system tray items (Closed)

Created:
8 years, 1 month ago by bartfab (slow)
Modified:
8 years, 1 month ago
Reviewers:
msw, stevenjb, oshima, sky, jennyz
CC:
chromium-reviews, msw+watch_chromium.org, sadrul, ben+watch_chromium.org, tfarina, gspencer+watch_chromium.org, gauravsh+watch_chromium.org, oshima+watch_chromium.org, alicet1, stevenjb+watch_chromium.org, oshima
Visibility:
Public.

Description

Stop using shell::GetInstance()->system_tray() in system tray items This CL provides all SystemTrayItem objects with a pointer to the parent SystemTray and all Tray*View objects with a pointer to the parent SystemTrayItem. This allows the objects to walk up the chain and access the correct system tray once multiple system trays are introduced. UpdateNagger::~UpdateNagger() in tray_update.cc continues to go through shell::GetInstance() as the refactoring needed to support multiple system trays here is more complex and out of my expertise. BUG=152928 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=169141

Patch Set 1 #

Total comments: 9

Patch Set 2 : Modified CL to provide TrayItems and Tray*Views with parent pointers instead. #

Total comments: 10

Patch Set 3 : Removed unnecessary forward declarations. Renamed |tray| to |owner|. #

Total comments: 10

Patch Set 4 : Nits addressed. #

Patch Set 5 : Removed unnecessary include. #

Patch Set 6 : Rebased. #

Patch Set 7 : Fix single-letter typo :(. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+236 lines, -189 lines) Patch
M ash/system/audio/tray_volume.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/audio/tray_volume.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M ash/system/bluetooth/tray_bluetooth.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/bluetooth/tray_bluetooth.cc View 1 2 4 chunks +8 lines, -6 lines 0 comments Download
M ash/system/brightness/tray_brightness.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/brightness/tray_brightness.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M ash/system/chromeos/network/network_detailed_view.h View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M ash/system/chromeos/network/network_list_detailed_view_base.h View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M ash/system/chromeos/network/network_list_detailed_view_base.cc View 1 2 3 3 chunks +5 lines, -2 lines 0 comments Download
M ash/system/chromeos/network/tray_network.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M ash/system/chromeos/network/tray_network.cc View 1 2 3 4 5 11 chunks +23 lines, -18 lines 0 comments Download
M ash/system/chromeos/network/tray_sms.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/chromeos/network/tray_sms.cc View 1 2 13 chunks +23 lines, -26 lines 0 comments Download
M ash/system/chromeos/network/tray_vpn.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M ash/system/chromeos/network/tray_vpn.cc View 1 2 3 4 5 3 chunks +9 lines, -5 lines 0 comments Download
M ash/system/chromeos/tray_display.h View 1 2 2 chunks +1 line, -2 lines 0 comments Download
M ash/system/chromeos/tray_display.cc View 1 1 chunk +3 lines, -2 lines 0 comments Download
M ash/system/date/tray_date.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/date/tray_date.cc View 1 2 3 4 5 6 2 chunks +6 lines, -6 lines 0 comments Download
M ash/system/drive/tray_drive.h View 1 2 2 chunks +1 line, -2 lines 0 comments Download
M ash/system/drive/tray_drive.cc View 1 2 4 chunks +5 lines, -5 lines 0 comments Download
M ash/system/ime/tray_ime.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/ime/tray_ime.cc View 1 2 6 chunks +12 lines, -11 lines 0 comments Download
M ash/system/locale/tray_locale.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/locale/tray_locale.cc View 1 2 2 chunks +5 lines, -4 lines 0 comments Download
M ash/system/logout_button/tray_logout_button.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/logout_button/tray_logout_button.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M ash/system/monitor/tray_monitor.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/monitor/tray_monitor.cc View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
M ash/system/power/tray_power.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/power/tray_power.cc View 1 2 2 chunks +5 lines, -4 lines 0 comments Download
M ash/system/settings/tray_settings.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/settings/tray_settings.cc View 1 2 1 chunk +3 lines, -2 lines 0 comments Download
M ash/system/tray/system_tray.cc View 1 2 chunks +20 lines, -19 lines 0 comments Download
M ash/system/tray/system_tray_item.h View 1 2 chunks +8 lines, -1 line 0 comments Download
M ash/system/tray/system_tray_item.cc View 1 3 chunks +8 lines, -12 lines 0 comments Download
M ash/system/tray/system_tray_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M ash/system/tray/tray_details_view.h View 1 2 4 chunks +6 lines, -1 line 0 comments Download
M ash/system/tray/tray_details_view.cc View 1 2 2 chunks +4 lines, -2 lines 0 comments Download
M ash/system/tray/tray_empty.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/tray/tray_empty.cc View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M ash/system/tray/tray_image_item.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/tray/tray_image_item.cc View 1 2 2 chunks +4 lines, -3 lines 0 comments Download
M ash/system/tray/tray_item_more.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M ash/system/tray/tray_item_more.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/tray/tray_item_view.h View 1 2 3 chunks +8 lines, -3 lines 0 comments Download
M ash/system/tray/tray_item_view.cc View 1 2 3 chunks +5 lines, -5 lines 0 comments Download
M ash/system/tray/tray_notification_view.h View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M ash/system/tray/tray_notification_view.cc View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M ash/system/tray_accessibility.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/tray_accessibility.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M ash/system/tray_caps_lock.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/tray_caps_lock.cc View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M ash/system/tray_update.h View 1 2 2 chunks +1 line, -2 lines 0 comments Download
M ash/system/tray_update.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download
M ash/system/user/tray_user.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M ash/system/user/tray_user.cc View 1 2 3 4 1 chunk +3 lines, -2 lines 0 comments Download
M ash/wm/shelf_layout_manager_unittest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 29 (0 generated)
bartfab (slow)
Hi Steven, Could you review the ash/system changes? Hi Mike, Could you review the tray_bubble_view.* ...
8 years, 1 month ago (2012-11-15 19:11:58 UTC) #1
msw
I'm not very familiar with TrayBubbleView code, but it seems to awkwardly work around the ...
8 years, 1 month ago (2012-11-15 21:08:48 UTC) #2
stevenjb
https://codereview.chromium.org/11415014/diff/1/ash/system/tray/system_tray_item.h File ash/system/tray/system_tray_item.h (right): https://codereview.chromium.org/11415014/diff/1/ash/system/tray/system_tray_item.h#newcode44 ash/system/tray/system_tray_item.h:44: int bubble_width); This is a lot of changes for ...
8 years, 1 month ago (2012-11-15 21:42:04 UTC) #3
bartfab (slow)
https://chromiumcodereview.appspot.com/11415014/diff/1/ash/system/tray/system_tray_item.h File ash/system/tray/system_tray_item.h (right): https://chromiumcodereview.appspot.com/11415014/diff/1/ash/system/tray/system_tray_item.h#newcode44 ash/system/tray/system_tray_item.h:44: int bubble_width); Done. This is a much bigger refactor ...
8 years, 1 month ago (2012-11-16 14:56:23 UTC) #4
bartfab (slow)
https://chromiumcodereview.appspot.com/11415014/diff/7001/ash/system/bluetooth/tray_bluetooth.cc File ash/system/bluetooth/tray_bluetooth.cc (right): https://chromiumcodereview.appspot.com/11415014/diff/7001/ash/system/bluetooth/tray_bluetooth.cc#newcode34 ash/system/bluetooth/tray_bluetooth.cc:34: explicit BluetoothDefaultView(SystemTrayItem* tray) I renamed |owner| to |tray| here ...
8 years, 1 month ago (2012-11-16 15:01:34 UTC) #5
msw
https://chromiumcodereview.appspot.com/11415014/diff/7001/ash/system/tray/system_tray_item.h File ash/system/tray/system_tray_item.h (right): https://chromiumcodereview.appspot.com/11415014/diff/7001/ash/system/tray/system_tray_item.h#newcode20 ash/system/tray/system_tray_item.h:20: class SystemTray; nit: this forward decl should make a ...
8 years, 1 month ago (2012-11-16 17:10:06 UTC) #6
bartfab (slow)
https://chromiumcodereview.appspot.com/11415014/diff/7001/ash/system/tray/system_tray_item.h File ash/system/tray/system_tray_item.h (right): https://chromiumcodereview.appspot.com/11415014/diff/7001/ash/system/tray/system_tray_item.h#newcode20 ash/system/tray/system_tray_item.h:20: class SystemTray; It does make them unnecessary in that ...
8 years, 1 month ago (2012-11-16 17:16:00 UTC) #7
msw
https://chromiumcodereview.appspot.com/11415014/diff/7001/ash/system/tray/system_tray_item.h File ash/system/tray/system_tray_item.h (right): https://chromiumcodereview.appspot.com/11415014/diff/7001/ash/system/tray/system_tray_item.h#newcode20 ash/system/tray/system_tray_item.h:20: class SystemTray; On 2012/11/16 17:16:01, bartfab wrote: > It ...
8 years, 1 month ago (2012-11-16 17:41:35 UTC) #8
stevenjb
+jennyz cc:oshima FYI Thanks a ton for doing this, it will be a huge help ...
8 years, 1 month ago (2012-11-16 17:41:42 UTC) #9
stevenjb
https://chromiumcodereview.appspot.com/11415014/diff/1/ash/system/tray/system_tray_item.h File ash/system/tray/system_tray_item.h (right): https://chromiumcodereview.appspot.com/11415014/diff/1/ash/system/tray/system_tray_item.h#newcode44 ash/system/tray/system_tray_item.h:44: int bubble_width); On 2012/11/16 14:56:24, bartfab wrote: > Done. ...
8 years, 1 month ago (2012-11-16 17:46:55 UTC) #10
bartfab (slow)
https://chromiumcodereview.appspot.com/11415014/diff/7001/ash/system/audio/tray_volume.h File ash/system/audio/tray_volume.h (right): https://chromiumcodereview.appspot.com/11415014/diff/7001/ash/system/audio/tray_volume.h#newcode13 ash/system/audio/tray_volume.h:13: class SystemTray; On 2012/11/16 17:41:43, stevenjb (chromium) wrote: > ...
8 years, 1 month ago (2012-11-16 18:45:34 UTC) #11
jennyz
lgtm
8 years, 1 month ago (2012-11-16 19:16:14 UTC) #12
stevenjb
Thanks a ton for doing this. LGTM
8 years, 1 month ago (2012-11-16 19:23:52 UTC) #13
msw
LGTM with a couple nits; thanks! https://chromiumcodereview.appspot.com/11415014/diff/2002/ash/system/chromeos/network/tray_network.cc File ash/system/chromeos/network/tray_network.cc (right): https://chromiumcodereview.appspot.com/11415014/diff/2002/ash/system/chromeos/network/tray_network.cc#newcode367 ash/system/chromeos/network/tray_network.cc:367: : NetworkDetailedView(owner) { ...
8 years, 1 month ago (2012-11-16 20:09:04 UTC) #14
bartfab (slow)
https://chromiumcodereview.appspot.com/11415014/diff/2002/ash/system/chromeos/network/tray_network.cc File ash/system/chromeos/network/tray_network.cc (right): https://chromiumcodereview.appspot.com/11415014/diff/2002/ash/system/chromeos/network/tray_network.cc#newcode367 ash/system/chromeos/network/tray_network.cc:367: : NetworkDetailedView(owner) { On 2012/11/16 20:09:04, msw wrote: > ...
8 years, 1 month ago (2012-11-19 17:15:30 UTC) #15
oshima
drive-by: https://chromiumcodereview.appspot.com/11415014/diff/2002/ash/system/user/tray_user.cc File ash/system/user/tray_user.cc (right): https://chromiumcodereview.appspot.com/11415014/diff/2002/ash/system/user/tray_user.cc#newcode8 ash/system/user/tray_user.cc:8: #include "ash/system/tray/system_tray.h" On 2012/11/19 17:15:31, bartfab wrote: > ...
8 years, 1 month ago (2012-11-19 17:43:42 UTC) #16
bartfab (slow)
https://chromiumcodereview.appspot.com/11415014/diff/2002/ash/system/user/tray_user.cc File ash/system/user/tray_user.cc (right): https://chromiumcodereview.appspot.com/11415014/diff/2002/ash/system/user/tray_user.cc#newcode8 ash/system/user/tray_user.cc:8: #include "ash/system/tray/system_tray.h" Actually, you are right. I can remove ...
8 years, 1 month ago (2012-11-19 18:00:30 UTC) #17
oshima
http://codereview.chromium.org/11415014/diff/2002/ash/system/user/tray_user.cc File ash/system/user/tray_user.cc (right): http://codereview.chromium.org/11415014/diff/2002/ash/system/user/tray_user.cc#newcode8 ash/system/user/tray_user.cc:8: #include "ash/system/tray/system_tray.h" On 2012/11/19 18:00:31, bartfab wrote: > Actually, ...
8 years, 1 month ago (2012-11-19 21:14:17 UTC) #18
bartfab (slow)
http://codereview.chromium.org/11415014/diff/2002/ash/system/user/tray_user.cc File ash/system/user/tray_user.cc (right): http://codereview.chromium.org/11415014/diff/2002/ash/system/user/tray_user.cc#newcode8 ash/system/user/tray_user.cc:8: #include "ash/system/tray/system_tray.h" Yes, of course. I addressed your comment ...
8 years, 1 month ago (2012-11-19 22:32:25 UTC) #19
oshima
lgtm http://codereview.chromium.org/11415014/diff/2002/ash/system/user/tray_user.cc File ash/system/user/tray_user.cc (right): http://codereview.chromium.org/11415014/diff/2002/ash/system/user/tray_user.cc#newcode8 ash/system/user/tray_user.cc:8: #include "ash/system/tray/system_tray.h" On 2012/11/19 22:32:25, bartfab wrote: > ...
8 years, 1 month ago (2012-11-19 22:53:12 UTC) #20
bartfab (slow)
http://codereview.chromium.org/11415014/diff/2002/ash/system/user/tray_user.cc File ash/system/user/tray_user.cc (right): http://codereview.chromium.org/11415014/diff/2002/ash/system/user/tray_user.cc#newcode8 ash/system/user/tray_user.cc:8: #include "ash/system/tray/system_tray.h" Absolutely. It was a mistake. On 2012/11/19 ...
8 years, 1 month ago (2012-11-19 22:57:54 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@chromium.org/11415014/107
8 years, 1 month ago (2012-11-20 10:36:44 UTC) #22
commit-bot: I haz the power
Presubmit check for 11415014-107 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 1 month ago (2012-11-20 10:37:22 UTC) #23
bartfab (slow)
Hi Scott, Review ping for shelf_layout_manager_unittest.cc.
8 years, 1 month ago (2012-11-20 10:45:26 UTC) #24
sky
LGTM
8 years, 1 month ago (2012-11-21 15:02:00 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@chromium.org/11415014/14001
8 years, 1 month ago (2012-11-21 15:02:59 UTC) #26
commit-bot: I haz the power
Sorry for I got bad news for ya. Compile failed with a clobber build on ...
8 years, 1 month ago (2012-11-21 15:40:41 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartfab@chromium.org/11415014/1055
8 years, 1 month ago (2012-11-21 19:36:53 UTC) #28
commit-bot: I haz the power
8 years, 1 month ago (2012-11-21 21:42:01 UTC) #29
Change committed as 169141

Powered by Google App Engine
This is Rietveld 408576698