Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_ | |
| 6 #define UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "ui/base/ui_base_export.h" | |
| 10 | |
| 11 template <typename T> struct DefaultSingletonTraits; | |
| 12 | |
| 13 namespace ui { | |
| 14 | |
| 15 class TextInputClient; | |
| 16 | |
| 17 // Manages the focused TextInputClient across windows and their contents. | |
|
Seigo Nonaka
2014/03/13 12:13:26
This class seems not thread safe and only designed
Yuki
2014/03/14 15:25:22
Unfortunately, either of ui/base and ui/views cann
tfarina
2014/03/14 19:58:56
I'd say, 'hopefuly' :)
Seigo Nonaka
2014/03/17 18:08:07
thread checker is in base/threading so you can use
Yuki
2014/04/16 09:24:08
Done.
| |
| 18 class UI_BASE_EXPORT TextInputFocusManager { | |
| 19 public: | |
| 20 static TextInputFocusManager* GetInstance(); | |
| 21 | |
| 22 // Returns the currently focused text input client or NULL. | |
| 23 TextInputClient* GetFocusedTextInputClient(); | |
| 24 | |
| 25 // Changes the text input focus to |text_input_client|. | |
| 26 void FocusTextInputClient(TextInputClient* text_input_client); | |
| 27 | |
| 28 // Removes the text input focus from |text_input_client|. If | |
| 29 // |text_input_client| was not focused, does nothing. | |
| 30 void BlurTextInputClient(TextInputClient* text_input_client); | |
| 31 | |
| 32 private: | |
| 33 friend struct DefaultSingletonTraits<TextInputFocusManager>; | |
| 34 | |
| 35 TextInputFocusManager(); | |
| 36 ~TextInputFocusManager(); | |
| 37 | |
| 38 TextInputClient* focused_text_input_client_; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(TextInputFocusManager); | |
| 41 }; | |
| 42 | |
| 43 } // namespace ui | |
| 44 | |
| 45 #endif // UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_ | |
| OLD | NEW |