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

Unified Diff: ash/common/system/tray/system_tray_notifier.cc

Issue 2576133002: chromeos: Remove OS ifdefs from ash/common/system/tray (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/system/tray/system_tray_notifier.cc
diff --git a/ash/common/system/tray/system_tray_notifier.cc b/ash/common/system/tray/system_tray_notifier.cc
index c443605ff14af649212d375c863ee10dc7f58c1e..1a5a034d5ce8ca3dff966628b002d97ccdd8c52e 100644
--- a/ash/common/system/tray/system_tray_notifier.cc
+++ b/ash/common/system/tray/system_tray_notifier.cc
@@ -5,11 +5,6 @@
#include "ash/common/system/tray/system_tray_notifier.h"
#include "ash/common/system/accessibility_observer.h"
-#include "ash/common/system/date/clock_observer.h"
-#include "ash/common/system/ime/ime_observer.h"
-#include "ash/common/system/user/user_observer.h"
-
-#if defined(OS_CHROMEOS)
#include "ash/common/system/chromeos/bluetooth/bluetooth_observer.h"
#include "ash/common/system/chromeos/enterprise/enterprise_domain_observer.h"
#include "ash/common/system/chromeos/network/network_observer.h"
@@ -21,7 +16,9 @@
#include "ash/common/system/chromeos/session/session_length_limit_observer.h"
#include "ash/common/system/chromeos/tray_tracing.h"
#include "ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_observer.h"
-#endif
+#include "ash/common/system/date/clock_observer.h"
+#include "ash/common/system/ime/ime_observer.h"
+#include "ash/common/system/user/user_observer.h"
namespace ash {
@@ -45,6 +42,29 @@ void SystemTrayNotifier::NotifyAccessibilityModeChanged(
observer.OnAccessibilityModeChanged(notify);
}
+void SystemTrayNotifier::AddBluetoothObserver(BluetoothObserver* observer) {
+ bluetooth_observers_.AddObserver(observer);
+}
+
+void SystemTrayNotifier::RemoveBluetoothObserver(BluetoothObserver* observer) {
+ bluetooth_observers_.RemoveObserver(observer);
+}
+
+void SystemTrayNotifier::NotifyRefreshBluetooth() {
+ for (auto& observer : bluetooth_observers_)
+ observer.OnBluetoothRefresh();
+}
+
+void SystemTrayNotifier::NotifyBluetoothDiscoveringChanged() {
+ for (auto& observer : bluetooth_observers_)
+ observer.OnBluetoothDiscoveringChanged();
+}
+
+void SystemTrayNotifier::AddEnterpriseDomainObserver(
msw 2016/12/14 22:51:00 nit: this belongs below with the other enterprise
James Cook 2016/12/14 23:46:08 Gack. Thanks for catching this.
+ EnterpriseDomainObserver* observer) {
+ enterprise_domain_observers_.AddObserver(observer);
+}
+
void SystemTrayNotifier::AddClockObserver(ClockObserver* observer) {
clock_observers_.AddObserver(observer);
}
@@ -73,6 +93,16 @@ void SystemTrayNotifier::NotifySystemClockCanSetTimeChanged(bool can_set_time) {
observer.OnSystemClockCanSetTimeChanged(can_set_time);
}
+void SystemTrayNotifier::RemoveEnterpriseDomainObserver(
+ EnterpriseDomainObserver* observer) {
+ enterprise_domain_observers_.RemoveObserver(observer);
+}
+
+void SystemTrayNotifier::NotifyEnterpriseDomainChanged() {
+ for (auto& observer : enterprise_domain_observers_)
+ observer.OnEnterpriseDomainChanged();
+}
+
void SystemTrayNotifier::AddIMEObserver(IMEObserver* observer) {
ime_observers_.AddObserver(observer);
}
@@ -91,61 +121,6 @@ void SystemTrayNotifier::NotifyRefreshIMEMenu(bool is_active) {
observer.OnIMEMenuActivationChanged(is_active);
}
-void SystemTrayNotifier::AddUserObserver(UserObserver* observer) {
- user_observers_.AddObserver(observer);
-}
-
-void SystemTrayNotifier::RemoveUserObserver(UserObserver* observer) {
- user_observers_.RemoveObserver(observer);
-}
-
-void SystemTrayNotifier::NotifyUserUpdate() {
- for (auto& observer : user_observers_)
- observer.OnUserUpdate();
-}
-
-void SystemTrayNotifier::NotifyUserAddedToSession() {
- for (auto& observer : user_observers_)
- observer.OnUserAddedToSession();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-#if defined(OS_CHROMEOS)
-
-void SystemTrayNotifier::AddBluetoothObserver(BluetoothObserver* observer) {
- bluetooth_observers_.AddObserver(observer);
-}
-
-void SystemTrayNotifier::RemoveBluetoothObserver(BluetoothObserver* observer) {
- bluetooth_observers_.RemoveObserver(observer);
-}
-
-void SystemTrayNotifier::NotifyRefreshBluetooth() {
- for (auto& observer : bluetooth_observers_)
- observer.OnBluetoothRefresh();
-}
-
-void SystemTrayNotifier::NotifyBluetoothDiscoveringChanged() {
- for (auto& observer : bluetooth_observers_)
- observer.OnBluetoothDiscoveringChanged();
-}
-
-void SystemTrayNotifier::AddEnterpriseDomainObserver(
- EnterpriseDomainObserver* observer) {
- enterprise_domain_observers_.AddObserver(observer);
-}
-
-void SystemTrayNotifier::RemoveEnterpriseDomainObserver(
- EnterpriseDomainObserver* observer) {
- enterprise_domain_observers_.RemoveObserver(observer);
-}
-
-void SystemTrayNotifier::NotifyEnterpriseDomainChanged() {
- for (auto& observer : enterprise_domain_observers_)
- observer.OnEnterpriseDomainChanged();
-}
-
void SystemTrayNotifier::AddLastWindowClosedObserver(
LastWindowClosedObserver* observer) {
last_window_closed_observers_.AddObserver(observer);
@@ -287,6 +262,24 @@ void SystemTrayNotifier::NotifyTracingModeChanged(bool value) {
observer.OnTracingModeChanged(value);
}
+void SystemTrayNotifier::AddUserObserver(UserObserver* observer) {
+ user_observers_.AddObserver(observer);
+}
+
+void SystemTrayNotifier::RemoveUserObserver(UserObserver* observer) {
+ user_observers_.RemoveObserver(observer);
+}
+
+void SystemTrayNotifier::NotifyUserUpdate() {
+ for (auto& observer : user_observers_)
+ observer.OnUserUpdate();
+}
+
+void SystemTrayNotifier::NotifyUserAddedToSession() {
+ for (auto& observer : user_observers_)
+ observer.OnUserAddedToSession();
+}
+
void SystemTrayNotifier::AddVirtualKeyboardObserver(
VirtualKeyboardObserver* observer) {
virtual_keyboard_observers_.AddObserver(observer);
@@ -303,6 +296,4 @@ void SystemTrayNotifier::NotifyVirtualKeyboardSuppressionChanged(
observer.OnKeyboardSuppressionChanged(suppressed);
}
-#endif // defined(OS_CHROMEOS)
-
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698