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 "chrome/browser/ui/ash/event_rewriter.h" | 5 #include "chrome/browser/ui/ash/event_rewriter.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 found_keyboard = true; | 193 found_keyboard = true; |
194 if (found_apple && found_keyboard) | 194 if (found_apple && found_keyboard) |
195 return kDeviceAppleKeyboard; | 195 return kDeviceAppleKeyboard; |
196 } | 196 } |
197 | 197 |
198 #if defined(OS_CHROMEOS) | 198 #if defined(OS_CHROMEOS) |
199 if (HasChromeOSKeyboard()) { | 199 if (HasChromeOSKeyboard()) { |
200 // The chromebook internal keyboard's name. | 200 // The chromebook internal keyboard's name. |
201 if (LowerCaseEqualsASCII(device_name, "at translated set 2 keyboard")) | 201 if (LowerCaseEqualsASCII(device_name, "at translated set 2 keyboard")) |
202 return kDeviceChromeOSKeyboard; | 202 return kDeviceChromeOSKeyboard; |
| 203 // The daisy chromebook internal keyboard's name. |
| 204 if (LowerCaseEqualsASCII(device_name, "chromeos-ec-i2c")) |
| 205 return kDeviceChromeOSKeyboard; |
203 // The chromebox chrome-specific keyboard's name. | 206 // The chromebox chrome-specific keyboard's name. |
204 if (LowerCaseEqualsASCII(device_name, "samsung usb keyboard")) | 207 if (LowerCaseEqualsASCII(device_name, "samsung usb keyboard")) |
205 return kDeviceChromeOSKeyboard; | 208 return kDeviceChromeOSKeyboard; |
206 } | 209 } |
207 #endif | 210 #endif |
208 | 211 |
209 return kDeviceUnknown; | 212 return kDeviceUnknown; |
210 } | 213 } |
211 | 214 |
212 void EventRewriter::RewriteForTesting(ui::KeyEvent* event) { | 215 void EventRewriter::RewriteForTesting(ui::KeyEvent* event) { |
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 } else if (type == kDeviceChromeOSKeyboard) { | 961 } else if (type == kDeviceChromeOSKeyboard) { |
959 VLOG(1) << "ChromeOS keyboard '" << device_name << "' connected: " | 962 VLOG(1) << "ChromeOS keyboard '" << device_name << "' connected: " |
960 << "id=" << device_id; | 963 << "id=" << device_id; |
961 #endif | 964 #endif |
962 } | 965 } |
963 // Always overwrite the existing device_id since the X server may reuse a | 966 // Always overwrite the existing device_id since the X server may reuse a |
964 // device id for an unattached device. | 967 // device id for an unattached device. |
965 device_id_to_type_[device_id] = type; | 968 device_id_to_type_[device_id] = type; |
966 return type; | 969 return type; |
967 } | 970 } |
OLD | NEW |