OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/input_method/input_method_engine_base.h" | 5 #include "chrome/browser/ui/input_method/input_method_engine_base.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #undef FocusIn | 9 #undef FocusIn |
10 #undef FocusOut | 10 #undef FocusOut |
11 #undef RootWindow | 11 #undef RootWindow |
12 #include <algorithm> | 12 #include <algorithm> |
13 #include <map> | 13 #include <map> |
14 | 14 |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/metrics/histogram_macros.h" | 16 #include "base/metrics/histogram_macros.h" |
17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
19 #include "base/strings/stringprintf.h" | |
20 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
21 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
22 #include "ui/aura/window.h" | 21 #include "ui/aura/window.h" |
23 #include "ui/aura/window_tree_host.h" | 22 #include "ui/aura/window_tree_host.h" |
24 #include "ui/base/ime/composition_text.h" | 23 #include "ui/base/ime/composition_text.h" |
25 #include "ui/base/ime/ime_bridge.h" | 24 #include "ui/base/ime/ime_bridge.h" |
26 #include "ui/base/ime/text_input_flags.h" | 25 #include "ui/base/ime/text_input_flags.h" |
27 #include "ui/events/event.h" | 26 #include "ui/events/event.h" |
28 #include "ui/events/event_processor.h" | 27 #include "ui/events/event_processor.h" |
29 #include "ui/events/event_utils.h" | 28 #include "ui/events/event_utils.h" |
30 #include "ui/events/keycodes/dom/dom_code.h" | 29 #include "ui/events/keycodes/dom/dom_code.h" |
31 #include "ui/events/keycodes/dom/keycode_converter.h" | 30 #include "ui/events/keycodes/dom/keycode_converter.h" |
32 #include "ui/keyboard/keyboard_controller.h" | 31 #include "ui/keyboard/keyboard_controller.h" |
33 #include "ui/keyboard/keyboard_util.h" | 32 #include "ui/keyboard/keyboard_util.h" |
34 | 33 |
35 #if defined(OS_CHROMEOS) | 34 #if defined(OS_CHROMEOS) |
36 #include "ui/base/ime/chromeos/ime_keymap.h" | 35 #include "ui/base/ime/chromeos/ime_keymap.h" |
37 #elif defined(OS_WIN) | 36 #elif defined(OS_WIN) |
38 #include "ui/events/keycodes/dom/keycode_converter.h" | |
39 #include "ui/events/keycodes/keyboard_codes_win.h" | 37 #include "ui/events/keycodes/keyboard_codes_win.h" |
40 #elif defined(OS_LINUX) | 38 #elif defined(OS_LINUX) |
41 #include "ui/events/keycodes/dom/keycode_converter.h" | |
42 #include "ui/events/keycodes/keyboard_codes_posix.h" | 39 #include "ui/events/keycodes/keyboard_codes_posix.h" |
43 #endif | 40 #endif |
44 | 41 |
45 namespace input_method { | 42 namespace input_method { |
46 | 43 |
47 namespace { | 44 namespace { |
48 | 45 |
49 const char kErrorNotActive[] = "IME is not active"; | 46 const char kErrorNotActive[] = "IME is not active"; |
50 const char kErrorWrongContext[] = "Context is not active"; | 47 const char kErrorWrongContext[] = "Context is not active"; |
51 | 48 |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 ui::EventTimeForNow()); | 451 ui::EventTimeForNow()); |
455 base::AutoReset<const ui::KeyEvent*> reset_sent_key(&sent_key_event_, | 452 base::AutoReset<const ui::KeyEvent*> reset_sent_key(&sent_key_event_, |
456 &ui_event); | 453 &ui_event); |
457 if (!SendKeyEvent(&ui_event, event.code)) | 454 if (!SendKeyEvent(&ui_event, event.code)) |
458 return false; | 455 return false; |
459 } | 456 } |
460 return true; | 457 return true; |
461 } | 458 } |
462 | 459 |
463 } // namespace input_method | 460 } // namespace input_method |
OLD | NEW |