| OLD | NEW |
| 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 "chromeos/ime/xkeyboard.h" | 5 #include "chromeos/ime/xkeyboard.h" |
| 6 | 6 |
| 7 #include <cstdlib> | 7 #include <cstdlib> |
| 8 #include <cstring> | 8 #include <cstring> |
| 9 #include <queue> | 9 #include <queue> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/chromeos/chromeos_version.h" | |
| 14 #include "base/logging.h" | 13 #include "base/logging.h" |
| 15 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "base/process/launch.h" |
| 17 #include "base/process/process_handle.h" | 17 #include "base/process/process_handle.h" |
| 18 #include "base/process/launch.h" | |
| 19 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 20 #include "base/strings/stringprintf.h" | 19 #include "base/strings/stringprintf.h" |
| 20 #include "base/sys_info.h" |
| 21 #include "base/threading/thread_checker.h" | 21 #include "base/threading/thread_checker.h" |
| 22 | 22 |
| 23 // These includes conflict with base/tracked_objects.h so must come last. | 23 // These includes conflict with base/tracked_objects.h so must come last. |
| 24 #include <X11/XKBlib.h> | 24 #include <X11/XKBlib.h> |
| 25 #include <X11/Xlib.h> | 25 #include <X11/Xlib.h> |
| 26 #include <glib.h> | 26 #include <glib.h> |
| 27 | 27 |
| 28 namespace chromeos { | 28 namespace chromeos { |
| 29 namespace input_method { | 29 namespace input_method { |
| 30 namespace { | 30 namespace { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 // A queue for executing setxkbmap one by one. | 108 // A queue for executing setxkbmap one by one. |
| 109 std::queue<std::string> execute_queue_; | 109 std::queue<std::string> execute_queue_; |
| 110 | 110 |
| 111 base::ThreadChecker thread_checker_; | 111 base::ThreadChecker thread_checker_; |
| 112 | 112 |
| 113 DISALLOW_COPY_AND_ASSIGN(XKeyboardImpl); | 113 DISALLOW_COPY_AND_ASSIGN(XKeyboardImpl); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 XKeyboardImpl::XKeyboardImpl() | 116 XKeyboardImpl::XKeyboardImpl() |
| 117 : is_running_on_chrome_os_(base::chromeos::IsRunningOnChromeOS()) { | 117 : is_running_on_chrome_os_(base::SysInfo::IsRunningOnChromeOS()) { |
| 118 num_lock_mask_ = GetNumLockMask(); | 118 num_lock_mask_ = GetNumLockMask(); |
| 119 | 119 |
| 120 // web_input_event_aurax11.cc seems to assume that Mod2Mask is always assigned | 120 // web_input_event_aurax11.cc seems to assume that Mod2Mask is always assigned |
| 121 // to Num Lock. | 121 // to Num Lock. |
| 122 // TODO(yusukes): Check the assumption is really okay. If not, modify the Aura | 122 // TODO(yusukes): Check the assumption is really okay. If not, modify the Aura |
| 123 // code, and then remove the CHECK below. | 123 // code, and then remove the CHECK below. |
| 124 CHECK(!is_running_on_chrome_os_ || (num_lock_mask_ == Mod2Mask)); | 124 CHECK(!is_running_on_chrome_os_ || (num_lock_mask_ == Mod2Mask)); |
| 125 GetLockedModifiers(¤t_caps_lock_status_, ¤t_num_lock_status_); | 125 GetLockedModifiers(¤t_caps_lock_status_, ¤t_num_lock_status_); |
| 126 } | 126 } |
| 127 | 127 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 return CheckLayoutName(layout_name); | 370 return CheckLayoutName(layout_name); |
| 371 } | 371 } |
| 372 | 372 |
| 373 // static | 373 // static |
| 374 XKeyboard* XKeyboard::Create() { | 374 XKeyboard* XKeyboard::Create() { |
| 375 return new XKeyboardImpl(); | 375 return new XKeyboardImpl(); |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace input_method | 378 } // namespace input_method |
| 379 } // namespace chromeos | 379 } // namespace chromeos |
| OLD | NEW |