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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 { | 756 { |
757 return volume_control_delegate_.get(); | 757 return volume_control_delegate_.get(); |
758 } | 758 } |
759 | 759 |
760 virtual void SetVolumeControlDelegate( | 760 virtual void SetVolumeControlDelegate( |
761 scoped_ptr<ash::VolumeControlDelegate> delegate) OVERRIDE { | 761 scoped_ptr<ash::VolumeControlDelegate> delegate) OVERRIDE { |
762 volume_control_delegate_.swap(delegate); | 762 volume_control_delegate_.swap(delegate); |
763 } | 763 } |
764 | 764 |
765 private: | 765 private: |
766 ash::SystemTray* GetSystemTray() { | 766 ash::SystemTray* GetPrimarySystemTray() { |
767 return ash::Shell::GetInstance()->system_tray(); | 767 return ash::Shell::GetInstance()->GetPrimarySystemTray(); |
768 } | 768 } |
769 | 769 |
770 ash::SystemTrayNotifier* GetSystemTrayNotifier() { | 770 ash::SystemTrayNotifier* GetSystemTrayNotifier() { |
771 return ash::Shell::GetInstance()->system_tray_notifier(); | 771 return ash::Shell::GetInstance()->system_tray_notifier(); |
772 } | 772 } |
773 | 773 |
774 // Returns the last active browser. If there is no such browser, creates a new | 774 // Returns the last active browser. If there is no such browser, creates a new |
775 // browser window with an empty tab and returns it. | 775 // browser window with an empty tab and returns it. |
776 Browser* GetAppropriateBrowser() { | 776 Browser* GetAppropriateBrowser() { |
777 return browser::FindOrCreateTabbedBrowser( | 777 return browser::FindOrCreateTabbedBrowser( |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 | 985 |
986 virtual bool ShouldOpenButtonOptions() const OVERRIDE { | 986 virtual bool ShouldOpenButtonOptions() const OVERRIDE { |
987 return false; | 987 return false; |
988 } | 988 } |
989 | 989 |
990 // Overridden from NetworkLibrary::NetworkManagerObserver. | 990 // Overridden from NetworkLibrary::NetworkManagerObserver. |
991 virtual void OnNetworkManagerChanged(NetworkLibrary* crosnet) OVERRIDE { | 991 virtual void OnNetworkManagerChanged(NetworkLibrary* crosnet) OVERRIDE { |
992 RefreshNetworkObserver(crosnet); | 992 RefreshNetworkObserver(crosnet); |
993 RefreshNetworkDeviceObserver(crosnet); | 993 RefreshNetworkDeviceObserver(crosnet); |
994 data_promo_notification_->ShowOptionalMobileDataPromoNotification( | 994 data_promo_notification_->ShowOptionalMobileDataPromoNotification( |
995 crosnet, GetSystemTray(), this); | 995 crosnet, GetPrimarySystemTray(), this); |
996 | 996 |
997 NotifyRefreshNetwork(); | 997 NotifyRefreshNetwork(); |
998 } | 998 } |
999 | 999 |
1000 // Overridden from NetworkLibrary::NetworkObserver. | 1000 // Overridden from NetworkLibrary::NetworkObserver. |
1001 virtual void OnNetworkChanged(NetworkLibrary* crosnet, | 1001 virtual void OnNetworkChanged(NetworkLibrary* crosnet, |
1002 const Network* network) OVERRIDE { | 1002 const Network* network) OVERRIDE { |
1003 NotifyRefreshNetwork(); | 1003 NotifyRefreshNetwork(); |
1004 } | 1004 } |
1005 | 1005 |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1247 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 1247 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
1248 }; | 1248 }; |
1249 | 1249 |
1250 } // namespace | 1250 } // namespace |
1251 | 1251 |
1252 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { | 1252 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { |
1253 return new chromeos::SystemTrayDelegate(); | 1253 return new chromeos::SystemTrayDelegate(); |
1254 } | 1254 } |
1255 | 1255 |
1256 } // namespace chromeos | 1256 } // namespace chromeos |
OLD | NEW |