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 #ifndef CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ | 5 #ifndef CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ |
6 #define CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ | 6 #define CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 bool is_visible) override; | 50 bool is_visible) override; |
51 void CommitTextToInputContext(int context_id, | 51 void CommitTextToInputContext(int context_id, |
52 const std::string& text) override; | 52 const std::string& text) override; |
53 bool SendKeyEvent(ui::KeyEvent* ui_event, const std::string& code) override; | 53 bool SendKeyEvent(ui::KeyEvent* ui_event, const std::string& code) override; |
54 | 54 |
55 // ui::ImeWindowObserver: | 55 // ui::ImeWindowObserver: |
56 void OnWindowDestroyed(ui::ImeWindow* ime_window) override; | 56 void OnWindowDestroyed(ui::ImeWindow* ime_window) override; |
57 | 57 |
58 ui::ImeWindow* FindWindowById(int window_id) const; | 58 ui::ImeWindow* FindWindowById(int window_id) const; |
59 | 59 |
| 60 // Checks if the page is special page that we want to disable some key events. |
| 61 bool IsSpecialPage(ui::InputMethod* method); |
| 62 |
| 63 // Checks if the key event are whitelisted key for all pages. |
| 64 bool IsValidKeyForAllPages(ui::KeyEvent* ui_event); |
| 65 |
60 // Holds the IME window instances for properly closing in the destructor. | 66 // Holds the IME window instances for properly closing in the destructor. |
61 // The follow-cursor window is singleton. | 67 // The follow-cursor window is singleton. |
62 // The normal windows cannot exceed the max count. | 68 // The normal windows cannot exceed the max count. |
63 ui::ImeWindow* follow_cursor_window_; // Weak. | 69 ui::ImeWindow* follow_cursor_window_; // Weak. |
64 std::vector<ui::ImeWindow*> normal_windows_; // Weak. | 70 std::vector<ui::ImeWindow*> normal_windows_; // Weak. |
65 | 71 |
66 // Tracks the current cursor bounds so that the new follow cursor window can | 72 // Tracks the current cursor bounds so that the new follow cursor window can |
67 // be aligned with cursor once it being created. | 73 // be aligned with cursor once it being created. |
68 gfx::Rect current_cursor_bounds_; | 74 gfx::Rect current_cursor_bounds_; |
69 | 75 |
70 DISALLOW_COPY_AND_ASSIGN(InputMethodEngine); | 76 DISALLOW_COPY_AND_ASSIGN(InputMethodEngine); |
71 }; | 77 }; |
72 | 78 |
73 } // namespace input_method | 79 } // namespace input_method |
74 | 80 |
75 #endif // CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ | 81 #endif // CHROME_BROWSER_UI_INPUT_METHOD_INPUT_METHOD_ENGINE_H_ |
OLD | NEW |