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

Side by Side Diff: chromeos/dbus/fake_bluetooth_input_client.cc

Issue 189753002: Bluetooth: use generic names for fake devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@modalias-device-id
Patch Set: Created 6 years, 9 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chromeos/dbus/fake_bluetooth_input_client.h" 5 #include "chromeos/dbus/fake_bluetooth_input_client.h"
6 6
7 #include <map> 7 #include <map>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 void FakeBluetoothInputClient::AddInputDevice( 78 void FakeBluetoothInputClient::AddInputDevice(
79 const dbus::ObjectPath& object_path) { 79 const dbus::ObjectPath& object_path) {
80 if (properties_map_.find(object_path) != properties_map_.end()) 80 if (properties_map_.find(object_path) != properties_map_.end())
81 return; 81 return;
82 82
83 Properties* properties = new Properties(base::Bind( 83 Properties* properties = new Properties(base::Bind(
84 &FakeBluetoothInputClient::OnPropertyChanged, 84 &FakeBluetoothInputClient::OnPropertyChanged,
85 base::Unretained(this), 85 base::Unretained(this),
86 object_path)); 86 object_path));
87 87
88 // Mark Apple mouse and keyboard as ReconnectMode "any" and the Motorola and 88 // The LegacyAutopair and DisplayPinCode devices represent a typical mouse
89 // Microsoft devices as ReconnectMode "device". 89 // and keyboard respectively, so mark them as ReconnectMode "any". The
90 if (object_path.value() == FakeBluetoothDeviceClient::kMotorolaKeyboardPath || 90 // DisplayPasskey device represents a Bluetooth 2.1+ keyboard and the
91 object_path.value() == FakeBluetoothDeviceClient::kMicrosoftMousePath) { 91 // ConnectUnpairable device represents a pre-standardization mouse, so mark
92 // them as ReconnectMode "device".
93 if (object_path.value() == FakeBluetoothDeviceClient::kDisplayPasskeyPath ||
94 object_path.value() ==
95 FakeBluetoothDeviceClient::kConnectUnpairablePath) {
92 properties->reconnect_mode.ReplaceValue( 96 properties->reconnect_mode.ReplaceValue(
93 bluetooth_input::kDeviceReconnectModeProperty); 97 bluetooth_input::kDeviceReconnectModeProperty);
94 } else { 98 } else {
95 properties->reconnect_mode.ReplaceValue( 99 properties->reconnect_mode.ReplaceValue(
96 bluetooth_input::kAnyReconnectModeProperty); 100 bluetooth_input::kAnyReconnectModeProperty);
97 } 101 }
98 102
99 properties_map_[object_path] = properties; 103 properties_map_[object_path] = properties;
100 104
101 FOR_EACH_OBSERVER(BluetoothInputClient::Observer, observers_, 105 FOR_EACH_OBSERVER(BluetoothInputClient::Observer, observers_,
(...skipping 15 matching lines...) Expand all
117 } 121 }
118 122
119 void FakeBluetoothInputClient::OnPropertyChanged( 123 void FakeBluetoothInputClient::OnPropertyChanged(
120 const dbus::ObjectPath& object_path, 124 const dbus::ObjectPath& object_path,
121 const std::string& property_name) { 125 const std::string& property_name) {
122 FOR_EACH_OBSERVER(BluetoothInputClient::Observer, observers_, 126 FOR_EACH_OBSERVER(BluetoothInputClient::Observer, observers_,
123 InputPropertyChanged(object_path, property_name)); 127 InputPropertyChanged(object_path, property_name));
124 } 128 }
125 129
126 } // namespace chromeos 130 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_bluetooth_device_client.cc ('k') | device/bluetooth/bluetooth_chromeos_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698