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

Side by Side Diff: ash/system/bluetooth/tray_bluetooth.h

Issue 11415014: Stop using shell::GetInstance()->system_tray() in system tray items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modified CL to provide TrayItems and Tray*Views with parent pointers instead. Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef ASH_SYSTEM_BLUETOOTH_TRAY_BLUETOOTH_H_ 5 #ifndef ASH_SYSTEM_BLUETOOTH_TRAY_BLUETOOTH_H_
6 #define ASH_SYSTEM_BLUETOOTH_TRAY_BLUETOOTH_H_ 6 #define ASH_SYSTEM_BLUETOOTH_TRAY_BLUETOOTH_H_
7 7
8 #include "ash/system/bluetooth/bluetooth_observer.h" 8 #include "ash/system/bluetooth/bluetooth_observer.h"
9 #include "ash/system/tray/system_tray_item.h" 9 #include "ash/system/tray/system_tray_item.h"
10 10
11 namespace ash { 11 namespace ash {
12
13 class SystemTray;
14
12 namespace internal { 15 namespace internal {
13 16
14 namespace tray { 17 namespace tray {
15 class BluetoothDefaultView; 18 class BluetoothDefaultView;
16 class BluetoothDetailedView; 19 class BluetoothDetailedView;
17 } 20 }
18 21
19 class TrayBluetooth : public SystemTrayItem, 22 class TrayBluetooth : public SystemTrayItem,
20 public BluetoothObserver { 23 public BluetoothObserver {
21 public: 24 public:
22 TrayBluetooth(); 25 explicit TrayBluetooth(SystemTray* system_tray);
23 virtual ~TrayBluetooth(); 26 virtual ~TrayBluetooth();
24 27
25 private: 28 private:
26 // Overridden from SystemTrayItem. 29 // Overridden from SystemTrayItem.
27 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; 30 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
28 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; 31 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
29 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; 32 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
30 virtual void DestroyTrayView() OVERRIDE; 33 virtual void DestroyTrayView() OVERRIDE;
31 virtual void DestroyDefaultView() OVERRIDE; 34 virtual void DestroyDefaultView() OVERRIDE;
32 virtual void DestroyDetailedView() OVERRIDE; 35 virtual void DestroyDetailedView() OVERRIDE;
33 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; 36 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE;
34 37
35 // Overridden from BluetoothObserver. 38 // Overridden from BluetoothObserver.
36 virtual void OnBluetoothRefresh() OVERRIDE; 39 virtual void OnBluetoothRefresh() OVERRIDE;
37 virtual void OnBluetoothDiscoveringChanged() OVERRIDE; 40 virtual void OnBluetoothDiscoveringChanged() OVERRIDE;
38 41
39 tray::BluetoothDefaultView* default_; 42 tray::BluetoothDefaultView* default_;
40 tray::BluetoothDetailedView* detailed_; 43 tray::BluetoothDetailedView* detailed_;
41 44
42 DISALLOW_COPY_AND_ASSIGN(TrayBluetooth); 45 DISALLOW_COPY_AND_ASSIGN(TrayBluetooth);
43 }; 46 };
44 47
45 } // namespace internal 48 } // namespace internal
46 } // namespace ash 49 } // namespace ash
47 50
48 #endif // ASH_SYSTEM_BLUETOOTH_TRAY_BLUETOOTH_H_ 51 #endif // ASH_SYSTEM_BLUETOOTH_TRAY_BLUETOOTH_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698