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

Issue 163953007: Refactor the TrayAudio code so that it can be used by other platforms. (Closed)

Created:
6 years, 10 months ago by zturner
Modified:
6 years, 10 months ago
Reviewers:
rkc, James Cook, jennyz
CC:
chromium-reviews, kalyank, stevenjb+watch_chromium.org, sadrul, oshima+watch_chromium.org, ben+ash_chromium.org
Visibility:
Public.

Description

Refactor the TrayAudio code so that it can be used by other platforms. The motivation here is to introduce the volume slider tray UI into Windows Ash. This change does not actually add tray audio UI to other platforms, only moves some non-chromeos specific things out of the chromeos platform folders, so that we can hook in the native Audio APIs of other platforms to the tray UI. At a high level, this change does the following: 1) Move tray_audio out of chromeos/ so that other platforms can use the UI that it provides. 2) Decouples TrayAudio from CrasAudioHandler by introducing a new delegate, in a similar vein to what is done with all the other handlers (e.g. the BluetoothHandler) 3) Move the additional views (VolumeView, etc) to their own files so they can be used by other platforms as well. TEST= On CrOS physical device, verified that: 1) Keyboard volume buttons function appropriately and display the volume view 2) AudioDetailView still is accessible at the correct times 3) Adjusting the volume (via the keyboard shortcuts or via the slider) correctly change the output volume. 4) UI still behaves correctly (e.g. icons update as the volume changes, mute button works, etc). BUG=227247 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=251959

Patch Set 1 #

Total comments: 28

Patch Set 2 : Only access CrasAudioObserver if audio system is initialized. #

Patch Set 3 : Address review comments. #

Patch Set 4 : Remove missing else condition #

Total comments: 5

Patch Set 5 : Fix copyrights and cleanup remaining nits. #

Patch Set 6 : Add virtual and OVERRIDE to overriden method. #

Patch Set 7 : Fix memory leak by using scoped_ptr in TrayAudio #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1241 lines, -752 lines) Patch
M ash/ash.gyp View 1 2 3 4 5 1 chunk +12 lines, -2 lines 0 comments Download
M ash/ash_switches.h View 1 chunk +1 line, -1 line 0 comments Download
M ash/ash_switches.cc View 1 chunk +5 lines, -1 line 0 comments Download
A ash/system/audio/audio_observer.h View 1 2 3 4 1 chunk +32 lines, -0 lines 0 comments Download
A + ash/system/audio/tray_audio.h View 1 2 3 4 5 6 2 chunks +25 lines, -20 lines 0 comments Download
A ash/system/audio/tray_audio.cc View 1 2 3 4 5 6 1 chunk +143 lines, -0 lines 0 comments Download
A ash/system/audio/tray_audio_delegate.h View 1 2 3 4 1 chunk +48 lines, -0 lines 0 comments Download
A ash/system/audio/volume_view.h View 1 2 3 4 5 1 chunk +90 lines, -0 lines 0 comments Download
A ash/system/audio/volume_view.cc View 1 2 3 4 1 chunk +332 lines, -0 lines 0 comments Download
A ash/system/chromeos/audio/audio_detailed_view.h View 1 2 3 4 1 chunk +66 lines, -0 lines 0 comments Download
A ash/system/chromeos/audio/audio_detailed_view.cc View 1 2 3 4 1 chunk +177 lines, -0 lines 0 comments Download
D ash/system/chromeos/audio/tray_audio.h View 1 chunk +0 lines, -61 lines 0 comments Download
D ash/system/chromeos/audio/tray_audio.cc View 1 chunk +0 lines, -663 lines 0 comments Download
A ash/system/chromeos/audio/tray_audio_chromeos.h View 1 2 3 4 5 6 1 chunk +42 lines, -0 lines 0 comments Download
A ash/system/chromeos/audio/tray_audio_chromeos.cc View 1 2 3 4 5 6 1 chunk +61 lines, -0 lines 0 comments Download
A ash/system/chromeos/audio/tray_audio_delegate_chromeos.h View 1 2 3 4 1 chunk +33 lines, -0 lines 0 comments Download
A ash/system/chromeos/audio/tray_audio_delegate_chromeos.cc View 1 2 3 4 1 chunk +65 lines, -0 lines 0 comments Download
M ash/system/tray/system_tray.cc View 1 2 3 4 5 6 3 chunks +3 lines, -2 lines 0 comments Download
M ash/system/tray/system_tray_notifier.h View 4 chunks +11 lines, -1 line 0 comments Download
M ash/system/tray/system_tray_notifier.cc View 2 chunks +43 lines, -0 lines 0 comments Download
M chrome/browser/ui/ash/system_tray_delegate_chromeos.h View 1 2 3 4 5 3 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/ui/ash/system_tray_delegate_chromeos.cc View 1 2 3 4 5 3 chunks +34 lines, -1 line 0 comments Download
M chromeos/audio/cras_audio_handler.h View 1 chunk +3 lines, -0 lines 0 comments Download
M chromeos/audio/cras_audio_handler.cc View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
zturner
6 years, 10 months ago (2014-02-13 23:20:34 UTC) #1
zturner
Note that because many files were moved to different folders, it might be difficult to ...
6 years, 10 months ago (2014-02-13 23:24:33 UTC) #2
jennyz
Adding rkc@ to review, since his extension code also use cras audio apis.
6 years, 10 months ago (2014-02-14 00:30:09 UTC) #3
James Cook
I'll take a look after jennyz/rkc
6 years, 10 months ago (2014-02-14 00:52:59 UTC) #4
jennyz
Mostly nits. This cl is pretty big and hard to diff due to the files ...
6 years, 10 months ago (2014-02-14 21:36:42 UTC) #5
jennyz
https://codereview.chromium.org/163953007/diff/1/ash/system/audio/audio_observer.h File ash/system/audio/audio_observer.h (right): https://codereview.chromium.org/163953007/diff/1/ash/system/audio/audio_observer.h#newcode10 ash/system/audio/audio_observer.h:10: class AudioObserver { On 2014/02/14 21:36:43, jennyz wrote: > ...
6 years, 10 months ago (2014-02-14 21:38:34 UTC) #6
jennyz
https://codereview.chromium.org/163953007/diff/1/ash/system/audio/tray_audio_delegate.h File ash/system/audio/tray_audio_delegate.h (right): https://codereview.chromium.org/163953007/diff/1/ash/system/audio/tray_audio_delegate.h#newcode27 ash/system/audio/tray_audio_delegate.h:27: virtual int GetDeviceIconId() = 0; On 2014/02/14 21:36:43, jennyz ...
6 years, 10 months ago (2014-02-14 21:40:04 UTC) #7
zturner
https://codereview.chromium.org/163953007/diff/1/ash/system/audio/tray_audio.h File ash/system/audio/tray_audio.h (right): https://codereview.chromium.org/163953007/diff/1/ash/system/audio/tray_audio.h#newcode27 ash/system/audio/tray_audio.h:27: system::TrayAudioDelegate* audio_delegate); On 2014/02/14 21:36:43, jennyz wrote: > Remove ...
6 years, 10 months ago (2014-02-15 00:57:44 UTC) #8
jennyz
lgtm with a minor nit. https://codereview.chromium.org/163953007/diff/300001/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc File chrome/browser/ui/ash/system_tray_delegate_chromeos.cc (right): https://codereview.chromium.org/163953007/diff/300001/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc#newcode92 chrome/browser/ui/ash/system_tray_delegate_chromeos.cc:92: #include "chromeos/audio/cras_audio_handler.h" nit: cras_audio_handler.h ...
6 years, 10 months ago (2014-02-18 17:57:48 UTC) #9
zturner
On 2014/02/18 17:57:48, jennyz wrote: > lgtm with a minor nit. > > https://codereview.chromium.org/163953007/diff/300001/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc > ...
6 years, 10 months ago (2014-02-18 18:11:04 UTC) #10
James Cook
chrome/browser/ui/ash LGTM with nits Also, please fix the copyright date across all added files before ...
6 years, 10 months ago (2014-02-18 19:34:48 UTC) #11
zturner
The CQ bit was checked by zturner@chromium.org
6 years, 10 months ago (2014-02-18 22:39:14 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/zturner@chromium.org/163953007/640001
6 years, 10 months ago (2014-02-18 22:42:05 UTC) #13
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-19 00:29:08 UTC) #14
commit-bot: I haz the power
Retried try job too often on linux_chromeos_clang for step(s) compile http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_chromeos_clang&number=73291
6 years, 10 months ago (2014-02-19 00:29:09 UTC) #15
zturner
The CQ bit was checked by zturner@chromium.org
6 years, 10 months ago (2014-02-19 00:46:07 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/zturner@chromium.org/163953007/710002
6 years, 10 months ago (2014-02-19 00:46:52 UTC) #17
commit-bot: I haz the power
Change committed as 251959
6 years, 10 months ago (2014-02-19 06:09:48 UTC) #18
earthdok
6 years, 10 months ago (2014-02-19 08:30:21 UTC) #19
Message was sent while issue was closed.
On 2014/02/19 06:09:48, I haz the power (commit-bot) wrote:
> Change committed as 251959

This broke the ASan bots:
http://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%20...

Powered by Google App Engine
This is Rietveld 408576698