Index: ui/base/ime/text_input_focus_manager.cc |
diff --git a/ui/base/ime/text_input_focus_manager.cc b/ui/base/ime/text_input_focus_manager.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2561c4f0fcc32d19c4d18727b747405ea9c93102 |
--- /dev/null |
+++ b/ui/base/ime/text_input_focus_manager.cc |
@@ -0,0 +1,35 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "ui/base/ime/text_input_focus_manager.h" |
+ |
+#include "base/memory/singleton.h" |
+ |
+namespace ui { |
+ |
+TextInputFocusManager::~TextInputFocusManager() {} |
+ |
+TextInputFocusManager* TextInputFocusManager::GetInstance() { |
+ return Singleton<TextInputFocusManager>::get(); |
+} |
+ |
+TextInputClient* TextInputFocusManager::GetFocusedTextInputClient() { |
+ return focused_text_input_client_; |
+} |
+ |
+void TextInputFocusManager::SetFocusedTextInputClient( |
+ TextInputClient* text_input_client) { |
+ focused_text_input_client_ = text_input_client; |
+} |
+ |
+void TextInputFocusManager::UnsetFocusedTextInputClient( |
msw
2014/03/11 00:58:50
Is this function even necessary? A call could easi
Yuki
2014/03/11 15:27:37
What the client would like to say is "forget me.
msw
2014/03/11 23:24:37
I'm on the fence about this, but I'll concede to y
|
+ TextInputClient* text_input_client) { |
+ if (focused_text_input_client_ == text_input_client) |
+ focused_text_input_client_ = NULL; |
+} |
+ |
+TextInputFocusManager::TextInputFocusManager() |
+ : focused_text_input_client_(NULL) {} |
+ |
+} // namespace ui |