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

Side by Side Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc

Issue 1931563002: Add Bluetooth device type icons on the device list in system tray. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <set> 10 #include <set>
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 chrome::ShowSettingsSubPageForProfile( 179 chrome::ShowSettingsSubPageForProfile(
180 ProfileManager::GetActiveUserProfile(), sub_page); 180 ProfileManager::GetActiveUserProfile(), sub_page);
181 } 181 }
182 182
183 void OnAcceptMultiprofilesIntro(bool no_show_again) { 183 void OnAcceptMultiprofilesIntro(bool no_show_again) {
184 PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs(); 184 PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs();
185 prefs->SetBoolean(prefs::kMultiProfileNeverShowIntro, no_show_again); 185 prefs->SetBoolean(prefs::kMultiProfileNeverShowIntro, no_show_again);
186 UserAddingScreen::Get()->Start(); 186 UserAddingScreen::Get()->Start();
187 } 187 }
188 188
189 ash::BluetoothDeviceInfo::DeviceType GetBluetoothDeviceType(
190 const device::BluetoothDevice* device) {
191 switch (device->GetDeviceType()) {
192 case device::BluetoothDevice::DEVICE_COMPUTER:
193 return ash::BluetoothDeviceInfo::DEVICE_COMPUTER;
194 case device::BluetoothDevice::DEVICE_PHONE:
195 return ash::BluetoothDeviceInfo::DEVICE_PHONE;
196 case device::BluetoothDevice::DEVICE_MODEM:
197 return ash::BluetoothDeviceInfo::DEVICE_MODEM;
198 case device::BluetoothDevice::DEVICE_AUDIO:
199 return ash::BluetoothDeviceInfo::DEVICE_AUDIO;
200 case device::BluetoothDevice::DEVICE_CAR_AUDIO:
201 return ash::BluetoothDeviceInfo::DEVICE_CAR_AUDIO;
202 case device::BluetoothDevice::DEVICE_VIDEO:
203 return ash::BluetoothDeviceInfo::DEVICE_VIDEO;
204 case device::BluetoothDevice::DEVICE_PERIPHERAL:
205 return ash::BluetoothDeviceInfo::DEVICE_PERIPHERAL;
206 case device::BluetoothDevice::DEVICE_JOYSTICK:
207 return ash::BluetoothDeviceInfo::DEVICE_JOYSTICK;
208 case device::BluetoothDevice::DEVICE_GAMEPAD:
209 return ash::BluetoothDeviceInfo::DEVICE_GAMEPAD;
210 case device::BluetoothDevice::DEVICE_KEYBOARD:
211 return ash::BluetoothDeviceInfo::DEVICE_KEYBOARD;
212 case device::BluetoothDevice::DEVICE_MOUSE:
213 return ash::BluetoothDeviceInfo::DEVICE_MOUSE;
214 case device::BluetoothDevice::DEVICE_TABLET:
215 return ash::BluetoothDeviceInfo::DEVICE_TABLET;
216 case device::BluetoothDevice::DEVICE_KEYBOARD_MOUSE_COMBO:
217 return ash::BluetoothDeviceInfo::DEVICE_KEYBOARD_MOUSE_COMBO;
218 default:
219 return ash::BluetoothDeviceInfo::DEVICE_UNKNOWN;
oshima 2016/04/27 20:31:27 ash can depends on /chromeos What's the reason to
jennyz 2016/04/27 23:27:38 ditto oshima's comment.
fukino 2016/04/28 00:02:26 In the Patch Set 1 of this CL, I directly referred
220 }
221 }
222
189 } // namespace 223 } // namespace
190 224
191 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS() 225 SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS()
192 : user_profile_(NULL), 226 : user_profile_(NULL),
193 clock_type_(base::GetHourClockType()), 227 clock_type_(base::GetHourClockType()),
194 search_key_mapped_to_(input_method::kSearchKey), 228 search_key_mapped_to_(input_method::kSearchKey),
195 screen_locked_(false), 229 screen_locked_(false),
196 have_session_start_time_(false), 230 have_session_start_time_(false),
197 have_session_length_limit_(false), 231 have_session_length_limit_(false),
198 should_run_bluetooth_discovery_(false), 232 should_run_bluetooth_discovery_(false),
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 654
621 void SystemTrayDelegateChromeOS::GetAvailableBluetoothDevices( 655 void SystemTrayDelegateChromeOS::GetAvailableBluetoothDevices(
622 ash::BluetoothDeviceList* list) { 656 ash::BluetoothDeviceList* list) {
623 device::BluetoothAdapter::DeviceList devices = 657 device::BluetoothAdapter::DeviceList devices =
624 bluetooth_adapter_->GetDevices(); 658 bluetooth_adapter_->GetDevices();
625 for (size_t i = 0; i < devices.size(); ++i) { 659 for (size_t i = 0; i < devices.size(); ++i) {
626 device::BluetoothDevice* device = devices[i]; 660 device::BluetoothDevice* device = devices[i];
627 ash::BluetoothDeviceInfo info; 661 ash::BluetoothDeviceInfo info;
628 info.address = device->GetAddress(); 662 info.address = device->GetAddress();
629 info.display_name = device->GetName(); 663 info.display_name = device->GetName();
664 info.device_type = GetBluetoothDeviceType(device);
630 info.connected = device->IsConnected(); 665 info.connected = device->IsConnected();
631 info.connecting = device->IsConnecting(); 666 info.connecting = device->IsConnecting();
632 info.paired = device->IsPaired(); 667 info.paired = device->IsPaired();
633 list->push_back(info); 668 list->push_back(info);
634 } 669 }
635 } 670 }
636 671
637 void SystemTrayDelegateChromeOS::BluetoothStartDiscovering() { 672 void SystemTrayDelegateChromeOS::BluetoothStartDiscovering() {
638 if (GetBluetoothDiscovering()) { 673 if (GetBluetoothDiscovering()) {
639 LOG(WARNING) << "Already have active Bluetooth device discovery session."; 674 LOG(WARNING) << "Already have active Bluetooth device discovery session.";
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1331 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while " 1366 LOG(WARNING) << "SystemTrayDelegateChromeOS::GetChildUserMessage call while "
1332 << "ENABLE_SUPERVISED_USERS undefined."; 1367 << "ENABLE_SUPERVISED_USERS undefined.";
1333 return base::string16(); 1368 return base::string16();
1334 } 1369 }
1335 1370
1336 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1371 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1337 return new SystemTrayDelegateChromeOS(); 1372 return new SystemTrayDelegateChromeOS();
1338 } 1373 }
1339 1374
1340 } // namespace chromeos 1375 } // namespace chromeos
OLDNEW
« ash/system/bluetooth/tray_bluetooth.cc ('K') | « ash/system/tray/system_tray_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698