Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: ash/system/bluetooth/tray_bluetooth.cc

Issue 2957043002: Add a row in the network tray to inform users to turn Bluetooth on to enable Tether. (Closed)
Patch Set: tdanderson@ and khorimoto@ comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(new TrayDetailsView::InfoLabel(
318 new InfoLabel(IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING)); 318 IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERING,
319 nullptr /* InfoLabelDelegate */));
Kyle Horimoto 2017/07/10 18:37:07 The comment should be the parameter name, not its
lesliewatkins 2017/07/12 21:49:49 Done.
319 } 320 }
320 321
321 // Focus the device which was focused before the device-list update. 322 // Focus the device which was focused before the device-list update.
322 if (!focused_device_address.empty()) 323 if (!focused_device_address.empty())
323 FocusDeviceByAddress(focused_device_address); 324 FocusDeviceByAddress(focused_device_address);
324 325
325 scroll_content()->InvalidateLayout(); 326 scroll_content()->InvalidateLayout();
326 } 327 }
327 328
328 void AppendSameTypeDevicesToScrollList(const BluetoothDeviceList& list, 329 void AppendSameTypeDevicesToScrollList(const BluetoothDeviceList& list,
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 detailed_->Update(); 571 detailed_->Update();
571 } 572 }
572 573
573 void TrayBluetooth::OnBluetoothDiscoveringChanged() { 574 void TrayBluetooth::OnBluetoothDiscoveringChanged() {
574 if (!detailed_) 575 if (!detailed_)
575 return; 576 return;
576 detailed_->Update(); 577 detailed_->Update();
577 } 578 }
578 579
579 } // namespace ash 580 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698