| 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/session/session_state_delegate.h" | 7 #include "ash/common/session/session_state_delegate.h" |
| 8 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth_helper.h" | 8 #include "ash/common/system/chromeos/bluetooth/tray_bluetooth_helper.h" |
| 9 #include "ash/common/system/tray/hover_highlight_view.h" | 9 #include "ash/common/system/tray/hover_highlight_view.h" |
| 10 #include "ash/common/system/tray/system_tray.h" | 10 #include "ash/common/system/tray/system_tray.h" |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 if (num_paired_devices > 0) | 307 if (num_paired_devices > 0) |
| 308 AddSubHeader(IDS_ASH_STATUS_TRAY_BLUETOOTH_UNPAIRED_DEVICES); | 308 AddSubHeader(IDS_ASH_STATUS_TRAY_BLUETOOTH_UNPAIRED_DEVICES); |
| 309 AppendSameTypeDevicesToScrollList(discovered_not_paired_devices_, false, | 309 AppendSameTypeDevicesToScrollList(discovered_not_paired_devices_, false, |
| 310 false, bluetooth_enabled); | 310 false, bluetooth_enabled); |
| 311 } | 311 } |
| 312 | 312 |
| 313 // Show user Bluetooth state if there is no bluetooth devices in list. | 313 // Show user Bluetooth state if there is no bluetooth devices in list. |
| 314 if (device_map_.size() == 0) { | 314 if (device_map_.size() == 0) { |
| 315 if (bluetooth_available && bluetooth_enabled) { | 315 if (bluetooth_available && bluetooth_enabled) { |
| 316 HoverHighlightView* container = new HoverHighlightView(this); | 316 HoverHighlightView* container = new HoverHighlightView(this); |
| 317 container->AddLabel(l10n_util::GetStringUTF16( | 317 container->AddLabelDeprecated( |
| 318 IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING), | 318 l10n_util::GetStringUTF16( |
| 319 gfx::ALIGN_LEFT, false); | 319 IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING), |
| 320 gfx::ALIGN_LEFT, false); |
| 320 scroll_content()->AddChildView(container); | 321 scroll_content()->AddChildView(container); |
| 321 } | 322 } |
| 322 } | 323 } |
| 323 | 324 |
| 324 // Focus the device which was focused before the device-list update. | 325 // Focus the device which was focused before the device-list update. |
| 325 if (!focused_device_address.empty()) | 326 if (!focused_device_address.empty()) |
| 326 FocusDeviceByAddress(focused_device_address); | 327 FocusDeviceByAddress(focused_device_address); |
| 327 | 328 |
| 328 scroll_content()->InvalidateLayout(); | 329 scroll_content()->InvalidateLayout(); |
| 329 } | 330 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 346 HoverHighlightView* AddScrollListItem(const base::string16& text, | 347 HoverHighlightView* AddScrollListItem(const base::string16& text, |
| 347 const gfx::ImageSkia& image, | 348 const gfx::ImageSkia& image, |
| 348 bool connected, | 349 bool connected, |
| 349 bool connecting) { | 350 bool connecting) { |
| 350 HoverHighlightView* container = new HoverHighlightView(this); | 351 HoverHighlightView* container = new HoverHighlightView(this); |
| 351 if (connected) { | 352 if (connected) { |
| 352 SetupConnectedItem(container, text, image); | 353 SetupConnectedItem(container, text, image); |
| 353 } else if (connecting) { | 354 } else if (connecting) { |
| 354 SetupConnectingItem(container, text, image); | 355 SetupConnectingItem(container, text, image); |
| 355 } else { | 356 } else { |
| 356 container->AddIconAndLabel(image, text, false); | 357 container->AddIconAndLabel(image, text); |
| 357 } | 358 } |
| 358 scroll_content()->AddChildView(container); | 359 scroll_content()->AddChildView(container); |
| 359 return container; | 360 return container; |
| 360 } | 361 } |
| 361 | 362 |
| 362 void AddSubHeader(int message_id) { | 363 void AddSubHeader(int message_id) { |
| 363 TriView* header = TrayPopupUtils::CreateSubHeaderRowView(); | 364 TriView* header = TrayPopupUtils::CreateSubHeaderRowView(); |
| 364 TrayPopupUtils::ConfigureAsStickyHeader(header); | 365 TrayPopupUtils::ConfigureAsStickyHeader(header); |
| 365 | 366 |
| 366 views::Label* label = TrayPopupUtils::CreateDefaultLabel(); | 367 views::Label* label = TrayPopupUtils::CreateDefaultLabel(); |
| (...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 646 detailed_->Update(); | 647 detailed_->Update(); |
| 647 } | 648 } |
| 648 | 649 |
| 649 void TrayBluetooth::OnBluetoothDiscoveringChanged() { | 650 void TrayBluetooth::OnBluetoothDiscoveringChanged() { |
| 650 if (!detailed_) | 651 if (!detailed_) |
| 651 return; | 652 return; |
| 652 detailed_->Update(); | 653 detailed_->Update(); |
| 653 } | 654 } |
| 654 | 655 |
| 655 } // namespace ash | 656 } // namespace ash |
| OLD | NEW |