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 "ash/system/bluetooth/tray_bluetooth.h" | 5 #include "ash/system/bluetooth/tray_bluetooth.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/system/tray/system_tray.h" | 8 #include "ash/system/tray/system_tray.h" |
9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
10 #include "ash/system/tray/tray_constants.h" | 10 #include "ash/system/tray/tray_constants.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 namespace ash { | 26 namespace ash { |
27 namespace internal { | 27 namespace internal { |
28 | 28 |
29 namespace tray { | 29 namespace tray { |
30 | 30 |
31 class BluetoothDefaultView : public TrayItemMore { | 31 class BluetoothDefaultView : public TrayItemMore { |
32 public: | 32 public: |
33 explicit BluetoothDefaultView(SystemTrayItem* owner) | 33 explicit BluetoothDefaultView(SystemTrayItem* owner) |
34 : TrayItemMore(owner) { | 34 : TrayItemMore(owner) { |
35 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 35 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
36 SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_BLUETOOTH).ToSkBitmap()); | 36 SetImage(bundle.GetImageNamed(IDR_AURA_UBER_TRAY_BLUETOOTH).ToImageSkia()); |
37 UpdateLabel(); | 37 UpdateLabel(); |
38 } | 38 } |
39 | 39 |
40 virtual ~BluetoothDefaultView() {} | 40 virtual ~BluetoothDefaultView() {} |
41 | 41 |
42 void UpdateLabel() { | 42 void UpdateLabel() { |
43 ash::SystemTrayDelegate* delegate = | 43 ash::SystemTrayDelegate* delegate = |
44 ash::Shell::GetInstance()->tray_delegate(); | 44 ash::Shell::GetInstance()->tray_delegate(); |
45 if (delegate->GetBluetoothAvailable()) { | 45 if (delegate->GetBluetoothAvailable()) { |
46 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 46 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 BluetoothDeviceList list; | 223 BluetoothDeviceList list; |
224 Shell::GetInstance()->tray_delegate()->GetAvailableBluetoothDevices(&list); | 224 Shell::GetInstance()->tray_delegate()->GetAvailableBluetoothDevices(&list); |
225 if (default_) | 225 if (default_) |
226 default_->UpdateLabel(); | 226 default_->UpdateLabel(); |
227 else if (detailed_) | 227 else if (detailed_) |
228 detailed_->Update(list); | 228 detailed_->Update(list); |
229 } | 229 } |
230 | 230 |
231 } // namespace internal | 231 } // namespace internal |
232 } // namespace ash | 232 } // namespace ash |
OLD | NEW |