summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-16 20:05:22 +0000
committerjennyz@chromium.org <jennyz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-16 20:05:22 +0000
commitd61538298a915a4b171fa3c1ca233830a66cc2b3 (patch)
tree9e3c613c96cf3a2d62240af55b5efb3c849eda0f
parent482023af338d2a588b130ca0d8b0039185aa4b76 (diff)
downloadchromium_src-d61538298a915a4b171fa3c1ca233830a66cc2b3.zip
chromium_src-d61538298a915a4b171fa3c1ca233830a66cc2b3.tar.gz
chromium_src-d61538298a915a4b171fa3c1ca233830a66cc2b3.tar.bz2
Move ash tray audio UI code from ash/system/audio to ash/system/chromeos/audio.
BUG=160311 TBR=sky Review URL: https://codereview.chromium.org/14077010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194429 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/ash.gyp6
-rw-r--r--ash/system/chromeos/audio/audio_observer.h (renamed from ash/system/audio/audio_observer.h)6
-rw-r--r--ash/system/chromeos/audio/tray_volume.cc (renamed from ash/system/audio/tray_volume.cc)2
-rw-r--r--ash/system/chromeos/audio/tray_volume.h (renamed from ash/system/audio/tray_volume.h)8
-rw-r--r--ash/system/tray/system_tray.cc4
-rw-r--r--ash/system/tray/system_tray_notifier.cc41
-rw-r--r--ash/system/tray/system_tray_notifier.h14
-rw-r--r--chrome/browser/chromeos/system/ash_system_tray_delegate.cc2
8 files changed, 42 insertions, 41 deletions
diff --git a/ash/ash.gyp b/ash/ash.gyp
index 192a27b..1ea89b8 100644
--- a/ash/ash.gyp
+++ b/ash/ash.gyp
@@ -175,9 +175,6 @@
'shell_delegate.h',
'shell_factory.h',
'shell_window_ids.h',
- 'system/audio/audio_observer.h',
- 'system/audio/tray_volume.cc',
- 'system/audio/tray_volume.h',
'system/bluetooth/bluetooth_observer.h',
'system/bluetooth/tray_bluetooth.cc',
'system/bluetooth/tray_bluetooth.h',
@@ -185,6 +182,9 @@
'system/brightness/brightness_control_delegate.h',
'system/brightness/tray_brightness.cc',
'system/brightness/tray_brightness.h',
+ 'system/chromeos/audio/audio_observer.h',
+ 'system/chromeos/audio/tray_volume.cc',
+ 'system/chromeos/audio/tray_volume.h',
'system/chromeos/enterprise/enterprise_domain_observer.h',
'system/chromeos/enterprise/tray_enterprise.h',
'system/chromeos/enterprise/tray_enterprise.cc',
diff --git a/ash/system/audio/audio_observer.h b/ash/system/chromeos/audio/audio_observer.h
index d0ff405..9d529c0 100644
--- a/ash/system/audio/audio_observer.h
+++ b/ash/system/chromeos/audio/audio_observer.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ASH_SYSTEM_AUDIO_AUDIO_OBSERVER_H_
-#define ASH_SYSTEM_AUDIO_AUDIO_OBSERVER_H_
+#ifndef ASH_SYSTEM_CHROMEOS_AUDIO_AUDIO_OBSERVER_H_
+#define ASH_SYSTEM_CHROMEOS_AUDIO_AUDIO_OBSERVER_H_
#include "ash/ash_export.h"
@@ -19,4 +19,4 @@ class ASH_EXPORT AudioObserver {
} // namespace ash
-#endif //ASH_SYSTEM_AUDIO_AUDIO_OBSERVER_H_
+#endif //ASH_SYSTEM_CHROMEOS_AUDIO_AUDIO_OBSERVER_H_
diff --git a/ash/system/audio/tray_volume.cc b/ash/system/chromeos/audio/tray_volume.cc
index ff9c979..7551a4b 100644
--- a/ash/system/audio/tray_volume.cc
+++ b/ash/system/chromeos/audio/tray_volume.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/system/audio/tray_volume.h"
+#include "ash/system/chromeos/audio/tray_volume.h"
#include <cmath>
diff --git a/ash/system/audio/tray_volume.h b/ash/system/chromeos/audio/tray_volume.h
index ec04943..601aa39 100644
--- a/ash/system/audio/tray_volume.h
+++ b/ash/system/chromeos/audio/tray_volume.h
@@ -2,10 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef ASH_SYSTEM_AUDIO_TRAY_VOLUME_H_
-#define ASH_SYSTEM_AUDIO_TRAY_VOLUME_H_
+#ifndef ASH_SYSTEM_CHROMEOS_AUDIO_TRAY_VOLUME_H_
+#define ASH_SYSTEM_CHROMEOS_AUDIO_TRAY_VOLUME_H_
-#include "ash/system/audio/audio_observer.h"
+#include "ash/system/chromeos/audio/audio_observer.h"
#include "ash/system/tray/tray_image_item.h"
namespace ash {
@@ -50,4 +50,4 @@ class TrayVolume : public TrayImageItem,
} // namespace internal
} // namespace ash
-#endif // ASH_SYSTEM_AUDIO_TRAY_VOLUME_H_
+#endif // ASH_SYSTEM_CHROMEOS_AUDIO_TRAY_VOLUME_H_
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
index cfe3730..8cbfddc 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -9,7 +9,6 @@
#include "ash/shell.h"
#include "ash/shell/panel_window.h"
#include "ash/shell_window_ids.h"
-#include "ash/system/audio/tray_volume.h"
#include "ash/system/bluetooth/tray_bluetooth.h"
#include "ash/system/brightness/tray_brightness.h"
#include "ash/system/date/tray_date.h"
@@ -51,6 +50,7 @@
#include "ui/views/view.h"
#if defined(OS_CHROMEOS)
+#include "ash/system/chromeos/audio/tray_volume.h"
#include "ash/system/chromeos/enterprise/tray_enterprise.h"
#include "ash/system/chromeos/network/tray_network.h"
#include "ash/system/chromeos/network/tray_sms.h"
@@ -162,9 +162,9 @@ void SystemTray::CreateItems(SystemTrayDelegate* delegate) {
#if defined(OS_CHROMEOS)
AddTrayItem(new internal::TrayDisplay(this));
AddTrayItem(new internal::TrayScreenCapture(this));
+ AddTrayItem(new internal::TrayVolume(this));
#endif
#if !defined(OS_WIN)
- AddTrayItem(new internal::TrayVolume(this));
AddTrayItem(new internal::TrayBrightness(this));
AddTrayItem(new internal::TrayCapsLock(this));
#endif
diff --git a/ash/system/tray/system_tray_notifier.cc b/ash/system/tray/system_tray_notifier.cc
index ae653a2..c8fa2c3 100644
--- a/ash/system/tray/system_tray_notifier.cc
+++ b/ash/system/tray/system_tray_notifier.cc
@@ -22,14 +22,6 @@ void SystemTrayNotifier::RemoveAccessibilityObserver(
accessibility_observers_.RemoveObserver(observer);
}
-void SystemTrayNotifier::AddAudioObserver(AudioObserver* observer) {
- audio_observers_.AddObserver(observer);
-}
-
-void SystemTrayNotifier::RemoveAudioObserver(AudioObserver* observer) {
- audio_observers_.RemoveObserver(observer);
-}
-
void SystemTrayNotifier::AddBluetoothObserver(BluetoothObserver* observer) {
bluetooth_observers_.AddObserver(observer);
}
@@ -134,6 +126,15 @@ void SystemTrayNotifier::RemoveUserObserver(UserObserver* observer) {
}
#if defined(OS_CHROMEOS)
+
+void SystemTrayNotifier::AddAudioObserver(AudioObserver* observer) {
+ audio_observers_.AddObserver(observer);
+}
+
+void SystemTrayNotifier::RemoveAudioObserver(AudioObserver* observer) {
+ audio_observers_.RemoveObserver(observer);
+}
+
void SystemTrayNotifier::AddNetworkObserver(NetworkObserver* observer) {
network_observers_.AddObserver(observer);
}
@@ -188,18 +189,6 @@ void SystemTrayNotifier::NotifyAccessibilityModeChanged(
OnAccessibilityModeChanged(notify));
}
-void SystemTrayNotifier::NotifyVolumeChanged(float level) {
- FOR_EACH_OBSERVER(AudioObserver,
- audio_observers_,
- OnVolumeChanged(level));
-}
-
-void SystemTrayNotifier::NotifyMuteToggled() {
- FOR_EACH_OBSERVER(AudioObserver,
- audio_observers_,
- OnMuteToggled());
-}
-
void SystemTrayNotifier::NotifyRefreshBluetooth() {
FOR_EACH_OBSERVER(BluetoothObserver,
bluetooth_observers_,
@@ -307,6 +296,18 @@ void SystemTrayNotifier::NotifyUserUpdate() {
#if defined(OS_CHROMEOS)
+void SystemTrayNotifier::NotifyVolumeChanged(float level) {
+ FOR_EACH_OBSERVER(AudioObserver,
+ audio_observers_,
+ OnVolumeChanged(level));
+}
+
+void SystemTrayNotifier::NotifyMuteToggled() {
+ FOR_EACH_OBSERVER(AudioObserver,
+ audio_observers_,
+ OnMuteToggled());
+}
+
void SystemTrayNotifier::NotifyRefreshNetwork(const NetworkIconInfo &info) {
FOR_EACH_OBSERVER(NetworkObserver,
network_observers_,
diff --git a/ash/system/tray/system_tray_notifier.h b/ash/system/tray/system_tray_notifier.h
index 58939eb7..76ad579 100644
--- a/ash/system/tray/system_tray_notifier.h
+++ b/ash/system/tray/system_tray_notifier.h
@@ -9,7 +9,6 @@
#include <vector>
#include "ash/ash_export.h"
-#include "ash/system/audio/audio_observer.h"
#include "ash/system/bluetooth/bluetooth_observer.h"
#include "ash/system/brightness/brightness_observer.h"
#include "ash/system/chromeos/enterprise/enterprise_domain_observer.h"
@@ -29,6 +28,7 @@
#include "base/observer_list.h"
#if defined(OS_CHROMEOS)
+#include "ash/system/chromeos/audio/audio_observer.h"
#include "ash/system/chromeos/network/network_observer.h"
#include "ash/system/chromeos/network/sms_observer.h"
#include "ash/system/chromeos/screen_capture/screen_capture_observer.h"
@@ -44,9 +44,6 @@ public:
void AddAccessibilityObserver(AccessibilityObserver* observer);
void RemoveAccessibilityObserver(AccessibilityObserver* observer);
- void AddAudioObserver(AudioObserver* observer);
- void RemoveAudioObserver(AudioObserver* observer);
-
void AddBluetoothObserver(BluetoothObserver* observer);
void RemoveBluetoothObserver(BluetoothObserver* observer);
@@ -84,6 +81,9 @@ public:
void RemoveUserObserver(UserObserver* observer);
#if defined(OS_CHROMEOS)
+ void AddAudioObserver(AudioObserver* observer);
+ void RemoveAudioObserver(AudioObserver* observer);
+
void AddNetworkObserver(NetworkObserver* observer);
void RemoveNetworkObserver(NetworkObserver* observer);
@@ -102,8 +102,6 @@ public:
void NotifyAccessibilityModeChanged(
AccessibilityNotificationVisibility notify);
- void NotifyVolumeChanged(float level);
- void NotifyMuteToggled();
void NotifyRefreshBluetooth();
void NotifyBluetoothDiscoveringChanged();
void NotifyBrightnessChanged(double level, bool user_initialted);
@@ -124,6 +122,8 @@ public:
void NotifyUpdateRecommended(UpdateObserver::UpdateSeverity severity);
void NotifyUserUpdate();
#if defined(OS_CHROMEOS)
+ void NotifyVolumeChanged(float level);
+ void NotifyMuteToggled();
void NotifyRefreshNetwork(const NetworkIconInfo &info);
void NotifySetNetworkMessage(NetworkTrayDelegate* delegate,
NetworkObserver::MessageType message_type,
@@ -143,7 +143,6 @@ public:
private:
ObserverList<AccessibilityObserver> accessibility_observers_;
- ObserverList<AudioObserver> audio_observers_;
ObserverList<BluetoothObserver> bluetooth_observers_;
ObserverList<BrightnessObserver> brightness_observers_;
ObserverList<CapsLockObserver> caps_lock_observers_;
@@ -157,6 +156,7 @@ public:
ObserverList<UpdateObserver> update_observers_;
ObserverList<UserObserver> user_observers_;
#if defined(OS_CHROMEOS)
+ ObserverList<AudioObserver> audio_observers_;
ObserverList<NetworkObserver> network_observers_;
ObserverList<NetworkObserver> vpn_observers_;
ObserverList<SmsObserver> sms_observers_;
diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
index 9b187a8..3f2b312 100644
--- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
+++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
@@ -14,9 +14,9 @@
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
-#include "ash/system/audio/audio_observer.h"
#include "ash/system/bluetooth/bluetooth_observer.h"
#include "ash/system/brightness/brightness_observer.h"
+#include "ash/system/chromeos/audio/audio_observer.h"
#include "ash/system/chromeos/network/network_observer.h"
#include "ash/system/chromeos/network/network_tray_delegate.h"
#include "ash/system/date/clock_observer.h"