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 // The TextInputFocusManager class manages which instance of TextInputClient | |
|
msw
2014/03/11 00:58:50
nit: remove "The TextInputFocusManager class"; con
Yuki
2014/03/11 15:27:37
Done.
| |
| 18 // has the text input focus. | |
| 19 class UI_BASE_EXPORT TextInputFocusManager { | |
| 20 public: | |
| 21 virtual ~TextInputFocusManager(); | |
|
msw
2014/03/11 00:58:50
nit: I don't think this needs to be virtual or pub
Yuki
2014/03/11 15:27:37
Done.
| |
| 22 | |
| 23 static TextInputFocusManager* GetInstance(); | |
| 24 | |
| 25 // Returns the currently focused text input client or NULL. | |
| 26 TextInputClient* GetFocusedTextInputClient(); | |
| 27 | |
| 28 // Changes the text input focus to |text_input_client|. | |
| 29 void SetFocusedTextInputClient(TextInputClient* text_input_client); | |
|
msw
2014/03/11 00:58:50
nit: consider "FocusTextInputClient"
Yuki
2014/03/11 15:27:37
Done.
| |
| 30 | |
| 31 // Removes the text input focus from |text_input_client|. If | |
| 32 // |text_input_client| was not focused, does nothing. | |
| 33 void UnsetFocusedTextInputClient(TextInputClient* text_input_client); | |
|
msw
2014/03/11 00:58:50
nit: consider "BlurTextInputClient" or "UnfocusTex
Yuki
2014/03/11 15:27:37
Done.
| |
| 34 | |
| 35 private: | |
| 36 TextInputFocusManager(); | |
| 37 | |
| 38 TextInputClient* focused_text_input_client_; | |
|
msw
2014/03/11 00:58:50
Is this better than views::FocusManager having a s
Yuki
2014/03/11 15:27:37
ui::InputMethod cannot access to views. ui::Input
msw
2014/03/11 23:24:37
Sounds good.
| |
| 39 | |
| 40 friend struct DefaultSingletonTraits<TextInputFocusManager>; | |
|
msw
2014/03/11 00:58:50
nit: friend types are commonly declared at the top
Yuki
2014/03/11 15:27:37
Done.
| |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(TextInputFocusManager); | |
| 43 }; | |
| 44 | |
| 45 } // namespace ui | |
| 46 | |
| 47 #endif // UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_ | |
| OLD | NEW |