| 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/common/system/chromeos/bluetooth/tray_bluetooth.h" | 5 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth.h" |
| 6 | 6 |
| 7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" | 9 #include "ash/common/system/tray/fixed_sized_scroll_view.h" |
| 10 #include "ash/common/system/tray/hover_highlight_view.h" | 10 #include "ash/common/system/tray/hover_highlight_view.h" |
| (...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 // Show user Bluetooth state if there is no bluetooth devices in list. | 322 // Show user Bluetooth state if there is no bluetooth devices in list. |
| 323 if (device_map_.size() == 0) { | 323 if (device_map_.size() == 0) { |
| 324 if (bluetooth_available && bluetooth_enabled) { | 324 if (bluetooth_available && bluetooth_enabled) { |
| 325 AddScrollListItem(l10n_util::GetStringUTF16( | 325 AddScrollListItem(l10n_util::GetStringUTF16( |
| 326 IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING), | 326 IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING), |
| 327 false /* highlight */, false /* checked */, | 327 false /* highlight */, false /* checked */, |
| 328 true /* enabled */); | 328 true /* enabled */); |
| 329 } | 329 } |
| 330 } | 330 } |
| 331 | 331 |
| 332 scroll_content()->SizeToPreferredSize(); | 332 scroll_content()->InvalidateLayout(); |
| 333 } | 333 } |
| 334 | 334 |
| 335 void AppendSameTypeDevicesToScrollList(const BluetoothDeviceList& list, | 335 void AppendSameTypeDevicesToScrollList(const BluetoothDeviceList& list, |
| 336 bool highlight, | 336 bool highlight, |
| 337 bool checked, | 337 bool checked, |
| 338 bool enabled) { | 338 bool enabled) { |
| 339 for (size_t i = 0; i < list.size(); ++i) { | 339 for (size_t i = 0; i < list.size(); ++i) { |
| 340 HoverHighlightView* container = nullptr; | 340 HoverHighlightView* container = nullptr; |
| 341 if (UseMd()) { | 341 if (UseMd()) { |
| 342 gfx::ImageSkia icon_image = CreateVectorIcon( | 342 gfx::ImageSkia icon_image = CreateVectorIcon( |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 detailed_->Update(); | 728 detailed_->Update(); |
| 729 } | 729 } |
| 730 | 730 |
| 731 void TrayBluetooth::OnBluetoothDiscoveringChanged() { | 731 void TrayBluetooth::OnBluetoothDiscoveringChanged() { |
| 732 if (!detailed_) | 732 if (!detailed_) |
| 733 return; | 733 return; |
| 734 detailed_->Update(); | 734 detailed_->Update(); |
| 735 } | 735 } |
| 736 | 736 |
| 737 } // namespace ash | 737 } // namespace ash |
| OLD | NEW |