OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_ | 5 #ifndef UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_ |
6 #define UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_ | 6 #define UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
10 #include "ui/base/ui_base_export.h" | 10 #include "ui/base/ime/ui_base_ime_export.h" |
11 | 11 |
12 template <typename T> struct DefaultSingletonTraits; | 12 template <typename T> struct DefaultSingletonTraits; |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 | 15 |
16 class TextInputClient; | 16 class TextInputClient; |
17 | 17 |
18 // Manages the focused TextInputClient across windows and their contents. | 18 // Manages the focused TextInputClient across windows and their contents. |
19 class UI_BASE_EXPORT TextInputFocusManager { | 19 class UI_BASE_IME_EXPORT TextInputFocusManager { |
20 public: | 20 public: |
21 static TextInputFocusManager* GetInstance(); | 21 static TextInputFocusManager* GetInstance(); |
22 | 22 |
23 // Returns the currently focused text input client or NULL. | 23 // Returns the currently focused text input client or NULL. |
24 TextInputClient* GetFocusedTextInputClient(); | 24 TextInputClient* GetFocusedTextInputClient(); |
25 | 25 |
26 // Changes the text input focus to |text_input_client|. | 26 // Changes the text input focus to |text_input_client|. |
27 void FocusTextInputClient(TextInputClient* text_input_client); | 27 void FocusTextInputClient(TextInputClient* text_input_client); |
28 | 28 |
29 // Removes the text input focus from |text_input_client|. If | 29 // Removes the text input focus from |text_input_client|. If |
30 // |text_input_client| was not focused, does nothing. | 30 // |text_input_client| was not focused, does nothing. |
31 void BlurTextInputClient(TextInputClient* text_input_client); | 31 void BlurTextInputClient(TextInputClient* text_input_client); |
32 | 32 |
33 private: | 33 private: |
34 friend struct DefaultSingletonTraits<TextInputFocusManager>; | 34 friend struct DefaultSingletonTraits<TextInputFocusManager>; |
35 | 35 |
36 TextInputFocusManager(); | 36 TextInputFocusManager(); |
37 ~TextInputFocusManager(); | 37 ~TextInputFocusManager(); |
38 | 38 |
39 TextInputClient* focused_text_input_client_; | 39 TextInputClient* focused_text_input_client_; |
40 base::ThreadChecker thread_checker_; | 40 base::ThreadChecker thread_checker_; |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(TextInputFocusManager); | 42 DISALLOW_COPY_AND_ASSIGN(TextInputFocusManager); |
43 }; | 43 }; |
44 | 44 |
45 } // namespace ui | 45 } // namespace ui |
46 | 46 |
47 #endif // UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_ | 47 #endif // UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_ |
OLD | NEW |