OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" | 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/system/audio/audio_observer.h" | 9 #include "ash/system/audio/audio_observer.h" |
10 #include "ash/system/bluetooth/bluetooth_observer.h" | 10 #include "ash/system/bluetooth/bluetooth_observer.h" |
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 } | 924 } |
925 | 925 |
926 // Overridden from PowerManagerClient::Observer. | 926 // Overridden from PowerManagerClient::Observer. |
927 virtual void BrightnessChanged(int level, bool user_initiated) OVERRIDE { | 927 virtual void BrightnessChanged(int level, bool user_initiated) OVERRIDE { |
928 tray_->brightness_observer()-> | 928 tray_->brightness_observer()-> |
929 OnBrightnessChanged(static_cast<double>(level), user_initiated); | 929 OnBrightnessChanged(static_cast<double>(level), user_initiated); |
930 } | 930 } |
931 | 931 |
932 virtual void PowerChanged(const PowerSupplyStatus& power_status) OVERRIDE { | 932 virtual void PowerChanged(const PowerSupplyStatus& power_status) OVERRIDE { |
933 power_supply_status_ = power_status; | 933 power_supply_status_ = power_status; |
934 ash::PowerStatusObserver* observer = tray_->power_status_observer(); | 934 FOR_EACH_OBSERVER(ash::PowerStatusObserver, tray_->power_status_observers(), |
935 if (observer) | 935 OnPowerStatusChanged(power_status)); |
936 observer->OnPowerStatusChanged(power_status); | |
937 } | 936 } |
938 | 937 |
939 virtual void SystemResumed() OVERRIDE { | 938 virtual void SystemResumed() OVERRIDE { |
940 NotifyRefreshClock(); | 939 NotifyRefreshClock(); |
941 } | 940 } |
942 | 941 |
943 virtual void LockScreen() OVERRIDE { | 942 virtual void LockScreen() OVERRIDE { |
944 screen_locked_ = true; | 943 screen_locked_ = true; |
945 tray_->UpdateAfterLoginStatusChange(GetUserLoginStatus()); | 944 tray_->UpdateAfterLoginStatusChange(GetUserLoginStatus()); |
946 } | 945 } |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1234 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
1236 }; | 1235 }; |
1237 | 1236 |
1238 } // namespace | 1237 } // namespace |
1239 | 1238 |
1240 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 1239 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
1241 return new chromeos::SystemTrayDelegate(tray); | 1240 return new chromeos::SystemTrayDelegate(tray); |
1242 } | 1241 } |
1243 | 1242 |
1244 } // namespace chromeos | 1243 } // namespace chromeos |
OLD | NEW |