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/chromeos/bluetooth/tray_bluetooth.h" | 5 #include "ash/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/tray/fixed_sized_scroll_view.h" | 8 #include "ash/common/system/tray/fixed_sized_scroll_view.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_delegate.h" | 10 #include "ash/common/system/tray/system_tray_delegate.h" |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 | 342 |
343 // Overridden from ViewClickListener. | 343 // Overridden from ViewClickListener. |
344 void OnViewClicked(views::View* sender) override { | 344 void OnViewClicked(views::View* sender) override { |
345 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); | 345 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); |
346 if (sender == footer()->content()) { | 346 if (sender == footer()->content()) { |
347 TransitionToDefaultView(); | 347 TransitionToDefaultView(); |
348 } else if (sender == manage_devices_) { | 348 } else if (sender == manage_devices_) { |
349 delegate->ManageBluetoothDevices(); | 349 delegate->ManageBluetoothDevices(); |
350 } else if (sender == enable_bluetooth_) { | 350 } else if (sender == enable_bluetooth_) { |
351 WmShell::Get()->RecordUserMetricsAction( | 351 WmShell::Get()->RecordUserMetricsAction( |
352 delegate->GetBluetoothEnabled() | 352 delegate->GetBluetoothEnabled() ? UMA_STATUS_AREA_BLUETOOTH_DISABLED |
353 ? UMA_STATUS_AREA_BLUETOOTH_DISABLED | 353 : UMA_STATUS_AREA_BLUETOOTH_ENABLED); |
354 : UMA_STATUS_AREA_BLUETOOTH_ENABLED); | |
355 delegate->ToggleBluetooth(); | 354 delegate->ToggleBluetooth(); |
356 } else { | 355 } else { |
357 if (!delegate->GetBluetoothEnabled()) | 356 if (!delegate->GetBluetoothEnabled()) |
358 return; | 357 return; |
359 std::map<views::View*, std::string>::iterator find; | 358 std::map<views::View*, std::string>::iterator find; |
360 find = device_map_.find(sender); | 359 find = device_map_.find(sender); |
361 if (find == device_map_.end()) | 360 if (find == device_map_.end()) |
362 return; | 361 return; |
363 const std::string device_id = find->second; | 362 const std::string device_id = find->second; |
364 if (FoundDevice(device_id, connecting_devices_, NULL)) | 363 if (FoundDevice(device_id, connecting_devices_, NULL)) |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 detailed_->Update(); | 443 detailed_->Update(); |
445 } | 444 } |
446 | 445 |
447 void TrayBluetooth::OnBluetoothDiscoveringChanged() { | 446 void TrayBluetooth::OnBluetoothDiscoveringChanged() { |
448 if (!detailed_) | 447 if (!detailed_) |
449 return; | 448 return; |
450 detailed_->Update(); | 449 detailed_->Update(); |
451 } | 450 } |
452 | 451 |
453 } // namespace ash | 452 } // namespace ash |
OLD | NEW |