| 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" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 #include "chrome/browser/prefs/pref_service.h" | 12 #include "chrome/browser/prefs/pref_service.h" |
| 13 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
| 14 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
| 15 #include "ui/base/event.h" | 15 #include "ui/base/events/event.h" |
| 16 #include "ui/base/keycodes/keyboard_code_conversion.h" | 16 #include "ui/base/keycodes/keyboard_code_conversion.h" |
| 17 | 17 |
| 18 #if defined(OS_CHROMEOS) | 18 #if defined(OS_CHROMEOS) |
| 19 #include <X11/extensions/XInput2.h> | 19 #include <X11/extensions/XInput2.h> |
| 20 #include <X11/keysym.h> | 20 #include <X11/keysym.h> |
| 21 #include <X11/Xlib.h> | 21 #include <X11/Xlib.h> |
| 22 | 22 |
| 23 // Get rid of a macro from Xlib.h that conflicts with OwnershipService class. | 23 // Get rid of a macro from Xlib.h that conflicts with OwnershipService class. |
| 24 #undef Status | 24 #undef Status |
| 25 | 25 |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 const DeviceType type = EventRewriter::GetDeviceType(device_name); | 694 const DeviceType type = EventRewriter::GetDeviceType(device_name); |
| 695 if (type == kDeviceAppleKeyboard) { | 695 if (type == kDeviceAppleKeyboard) { |
| 696 VLOG(1) << "Apple keyboard '" << device_name << "' connected: " | 696 VLOG(1) << "Apple keyboard '" << device_name << "' connected: " |
| 697 << "id=" << device_id; | 697 << "id=" << device_id; |
| 698 } | 698 } |
| 699 // Always overwrite the existing device_id since the X server may reuse a | 699 // Always overwrite the existing device_id since the X server may reuse a |
| 700 // device id for an unattached device. | 700 // device id for an unattached device. |
| 701 device_id_to_type_[device_id] = type; | 701 device_id_to_type_[device_id] = type; |
| 702 return type; | 702 return type; |
| 703 } | 703 } |
| OLD | NEW |