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 <map> | 7 #include <map> |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // present, also add a section header above the unpaired devices. | 307 // present, also add a section header above the unpaired devices. |
308 if (discovered_not_paired_devices_.size() > 0) { | 308 if (discovered_not_paired_devices_.size() > 0) { |
309 if (num_paired_devices > 0) | 309 if (num_paired_devices > 0) |
310 AddScrollListSubHeader(IDS_ASH_STATUS_TRAY_BLUETOOTH_UNPAIRED_DEVICES); | 310 AddScrollListSubHeader(IDS_ASH_STATUS_TRAY_BLUETOOTH_UNPAIRED_DEVICES); |
311 AppendSameTypeDevicesToScrollList(discovered_not_paired_devices_, false, | 311 AppendSameTypeDevicesToScrollList(discovered_not_paired_devices_, false, |
312 false, bluetooth_enabled); | 312 false, bluetooth_enabled); |
313 } | 313 } |
314 | 314 |
315 // Show user Bluetooth state if there is no bluetooth devices in list. | 315 // Show user Bluetooth state if there is no bluetooth devices in list. |
316 if (device_map_.size() == 0 && bluetooth_available && bluetooth_enabled) { | 316 if (device_map_.size() == 0 && bluetooth_available && bluetooth_enabled) { |
317 scroll_content()->AddChildView( | 317 scroll_content()->AddChildView(TrayDetailsView::CreateInfoLabel( |
318 new InfoLabel(IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING)); | 318 IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING)); |
319 } | 319 } |
320 | 320 |
321 // Focus the device which was focused before the device-list update. | 321 // Focus the device which was focused before the device-list update. |
322 if (!focused_device_address.empty()) | 322 if (!focused_device_address.empty()) |
323 FocusDeviceByAddress(focused_device_address); | 323 FocusDeviceByAddress(focused_device_address); |
324 | 324 |
325 scroll_content()->InvalidateLayout(); | 325 scroll_content()->InvalidateLayout(); |
326 } | 326 } |
327 | 327 |
328 void AppendSameTypeDevicesToScrollList(const BluetoothDeviceList& list, | 328 void AppendSameTypeDevicesToScrollList(const BluetoothDeviceList& list, |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 detailed_->Update(); | 570 detailed_->Update(); |
571 } | 571 } |
572 | 572 |
573 void TrayBluetooth::OnBluetoothDiscoveringChanged() { | 573 void TrayBluetooth::OnBluetoothDiscoveringChanged() { |
574 if (!detailed_) | 574 if (!detailed_) |
575 return; | 575 return; |
576 detailed_->Update(); | 576 detailed_->Update(); |
577 } | 577 } |
578 | 578 |
579 } // namespace ash | 579 } // namespace ash |
OLD | NEW |