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/fixed_sized_scroll_view.h" | 8 #include "ash/system/tray/fixed_sized_scroll_view.h" |
9 #include "ash/system/tray/hover_highlight_view.h" | 9 #include "ash/system/tray/hover_highlight_view.h" |
10 #include "ash/system/tray/system_tray.h" | 10 #include "ash/system/tray/system_tray.h" |
11 #include "ash/system/tray/system_tray_delegate.h" | 11 #include "ash/system/tray/system_tray_delegate.h" |
12 #include "ash/system/tray/system_tray_notifier.h" | 12 #include "ash/system/tray/system_tray_notifier.h" |
13 #include "ash/system/tray/throbber_view.h" | 13 #include "ash/system/tray/throbber_view.h" |
14 #include "ash/system/tray/tray_constants.h" | 14 #include "ash/system/tray/tray_constants.h" |
15 #include "ash/system/tray/tray_details_view.h" | 15 #include "ash/system/tray/tray_details_view.h" |
16 #include "ash/system/tray/tray_item_more.h" | 16 #include "ash/system/tray/tray_item_more.h" |
17 #include "ash/system/tray/tray_popup_header_button.h" | 17 #include "ash/system/tray/tray_popup_header_button.h" |
18 #include "grit/ash_resources.h" | 18 #include "grit/ash_resources.h" |
19 #include "grit/ash_strings.h" | 19 #include "grit/ash_strings.h" |
20 #include "ui/base/l10n/l10n_util.h" | 20 #include "ui/base/l10n/l10n_util.h" |
21 #include "ui/base/resource/resource_bundle.h" | 21 #include "ui/base/resource/resource_bundle.h" |
22 #include "ui/gfx/image/image.h" | 22 #include "ui/gfx/image/image.h" |
23 #include "ui/views/controls/image_view.h" | 23 #include "ui/views/controls/image_view.h" |
24 #include "ui/views/controls/label.h" | 24 #include "ui/views/controls/label.h" |
25 #include "ui/views/layout/box_layout.h" | 25 #include "ui/views/layout/box_layout.h" |
26 | 26 |
27 namespace ash { | 27 namespace ash { |
28 namespace internal { | |
29 | |
30 namespace tray { | 28 namespace tray { |
31 | |
32 namespace { | 29 namespace { |
33 | 30 |
34 // Updates bluetooth device |device| in the |list|. If it is new, append to the | 31 // Updates bluetooth device |device| in the |list|. If it is new, append to the |
35 // end of the |list|; otherwise, keep it at the same place, but update the data | 32 // end of the |list|; otherwise, keep it at the same place, but update the data |
36 // with new device info provided by |device|. | 33 // with new device info provided by |device|. |
37 void UpdateBluetoothDeviceListHelper(BluetoothDeviceList* list, | 34 void UpdateBluetoothDeviceListHelper(BluetoothDeviceList* list, |
38 const BluetoothDeviceInfo& device) { | 35 const BluetoothDeviceInfo& device) { |
39 for (BluetoothDeviceList::iterator it = list->begin(); it != list->end(); | 36 for (BluetoothDeviceList::iterator it = list->begin(); it != list->end(); |
40 ++it) { | 37 ++it) { |
41 if ((*it).address == device.address) { | 38 if ((*it).address == device.address) { |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 else if (detailed_) | 455 else if (detailed_) |
459 detailed_->Update(); | 456 detailed_->Update(); |
460 } | 457 } |
461 | 458 |
462 void TrayBluetooth::OnBluetoothDiscoveringChanged() { | 459 void TrayBluetooth::OnBluetoothDiscoveringChanged() { |
463 if (!detailed_) | 460 if (!detailed_) |
464 return; | 461 return; |
465 detailed_->Update(); | 462 detailed_->Update(); |
466 } | 463 } |
467 | 464 |
468 } // namespace internal | |
469 } // namespace ash | 465 } // namespace ash |
OLD | NEW |