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> |
(...skipping 15 matching lines...) Expand all Loading... |
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 { |
31 | 31 |
32 Display* GetXDisplay() { | 32 Display* GetXDisplay() { |
33 return base::MessagePumpForUI::GetDefaultXDisplay(); | 33 return base::MessagePumpForUI::GetDefaultXDisplay(); |
34 } | 34 } |
35 | 35 |
36 // The default keyboard layout name in the xorg config file. | |
37 const char kDefaultLayoutName[] = "us"; | |
38 | |
39 // The command we use to set the current XKB layout and modifier key mapping. | 36 // The command we use to set the current XKB layout and modifier key mapping. |
40 // TODO(yusukes): Use libxkbfile.so instead of the command (crosbug.com/13105) | 37 // TODO(yusukes): Use libxkbfile.so instead of the command (crosbug.com/13105) |
41 const char kSetxkbmapCommand[] = "/usr/bin/setxkbmap"; | 38 const char kSetxkbmapCommand[] = "/usr/bin/setxkbmap"; |
42 | 39 |
43 // A string for obtaining a mask value for Num Lock. | 40 // A string for obtaining a mask value for Num Lock. |
44 const char kNumLockVirtualModifierString[] = "NumLock"; | 41 const char kNumLockVirtualModifierString[] = "NumLock"; |
45 | 42 |
46 // Returns false if |layout_name| contains a bad character. | 43 // Returns false if |layout_name| contains a bad character. |
47 bool CheckLayoutName(const std::string& layout_name) { | 44 bool CheckLayoutName(const std::string& layout_name) { |
48 static const char kValidLayoutNameCharacters[] = | 45 static const char kValidLayoutNameCharacters[] = |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 return CheckLayoutName(layout_name); | 367 return CheckLayoutName(layout_name); |
371 } | 368 } |
372 | 369 |
373 // static | 370 // static |
374 XKeyboard* XKeyboard::Create() { | 371 XKeyboard* XKeyboard::Create() { |
375 return new XKeyboardImpl(); | 372 return new XKeyboardImpl(); |
376 } | 373 } |
377 | 374 |
378 } // namespace input_method | 375 } // namespace input_method |
379 } // namespace chromeos | 376 } // namespace chromeos |
OLD | NEW |