| Index: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
|
| diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
|
| index a78cad3166ccac5514271bb79753e08915d87304..28b26fa6b009a8e3f24bfeb2da77c50ef284b7ef 100644
|
| --- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
|
| +++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
|
| @@ -13,6 +13,7 @@
|
| #include <vector>
|
|
|
| #include "ash/common/login_status.h"
|
| +#include "ash/common/material_design/material_design_controller.h"
|
| #include "ash/common/session/session_state_delegate.h"
|
| #include "ash/common/session/session_state_observer.h"
|
| #include "ash/common/shell_delegate.h"
|
| @@ -26,11 +27,13 @@
|
| #include "ash/common/system/tray/system_tray.h"
|
| #include "ash/common/system/tray/system_tray_delegate.h"
|
| #include "ash/common/system/tray/system_tray_notifier.h"
|
| +#include "ash/common/system/tray/tray_constants.h"
|
| #include "ash/common/system/tray_accessibility.h"
|
| #include "ash/common/system/update/update_observer.h"
|
| #include "ash/common/system/user/user_observer.h"
|
| #include "ash/common/system/volume_control_delegate.h"
|
| #include "ash/common/wm_shell.h"
|
| +#include "ash/resources/vector_icons/vector_icons.h"
|
| #include "ash/shell.h"
|
| #include "ash/system/chromeos/rotation/tray_rotation_lock.h"
|
| #include "ash/wm/lock_state_controller.h"
|
| @@ -115,6 +118,7 @@
|
| #include "ui/base/l10n/time_format.h"
|
| #include "ui/chromeos/ime/input_method_menu_item.h"
|
| #include "ui/chromeos/ime/input_method_menu_manager.h"
|
| +#include "ui/gfx/paint_vector_icon.h"
|
|
|
| #if defined(ENABLE_SUPERVISED_USERS)
|
| #include "chrome/browser/supervised_user/supervised_user_service.h"
|
| @@ -164,6 +168,37 @@ void BluetoothDeviceConnectError(
|
| device::BluetoothDevice::ConnectErrorCode error_code) {
|
| }
|
|
|
| +const gfx::VectorIcon& GetBluetoothDeviceIcon(
|
| + device::BluetoothDevice::DeviceType device_type) {
|
| + switch (device_type) {
|
| + case device::BluetoothDevice::DEVICE_COMPUTER:
|
| + return ash::kSystemMenuComputerIcon;
|
| + case device::BluetoothDevice::DEVICE_PHONE:
|
| + return ash::kSystemMenuPhoneIcon;
|
| + case device::BluetoothDevice::DEVICE_AUDIO:
|
| + case device::BluetoothDevice::DEVICE_CAR_AUDIO:
|
| + return ash::kSystemMenuHeadsetIcon;
|
| + case device::BluetoothDevice::DEVICE_VIDEO:
|
| + return ash::kSystemMenuVideocamIcon;
|
| + case device::BluetoothDevice::DEVICE_JOYSTICK:
|
| + case device::BluetoothDevice::DEVICE_GAMEPAD:
|
| + return ash::kSystemMenuGamepadIcon;
|
| + case device::BluetoothDevice::DEVICE_KEYBOARD:
|
| + case device::BluetoothDevice::DEVICE_KEYBOARD_MOUSE_COMBO:
|
| + return ash::kSystemMenuKeyboardIcon;
|
| + case device::BluetoothDevice::DEVICE_TABLET:
|
| + return ash::kSystemMenuTabletIcon;
|
| + case device::BluetoothDevice::DEVICE_MOUSE:
|
| + return ash::kSystemMenuMouseIcon;
|
| + case device::BluetoothDevice::DEVICE_UNKNOWN:
|
| + LOG(WARNING) << "Unknown device type icon for Bluetooth was requested.";
|
| + break;
|
| + default:
|
| + break;
|
| + }
|
| + return ash::kSystemMenuBluetoothIcon;
|
| +}
|
| +
|
| std::unique_ptr<ash::CastConfigDelegate> CreateCastConfigDelegate() {
|
| if (CastConfigDelegateMediaRouter::IsEnabled())
|
| return base::MakeUnique<CastConfigDelegateMediaRouter>();
|
| @@ -597,6 +632,10 @@ void SystemTrayDelegateChromeOS::GetAvailableBluetoothDevices(
|
| info.connected = device->IsConnected();
|
| info.connecting = device->IsConnecting();
|
| info.paired = device->IsPaired();
|
| + if (ash::MaterialDesignController::IsSystemTrayMenuMaterial()) {
|
| + info.icon_image = gfx::CreateVectorIcon(
|
| + GetBluetoothDeviceIcon(device->GetDeviceType()), ash::kMenuIconColor);
|
| + }
|
| list->push_back(info);
|
| }
|
| }
|
|
|