Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Unified Diff: ui/base/ime/text_input_focus_manager.h

Issue 173803002: Redesigns the text input focus handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/ime/input_method_base.cc ('k') | ui/base/ime/text_input_focus_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ime/text_input_focus_manager.h
diff --git a/ui/base/ime/text_input_focus_manager.h b/ui/base/ime/text_input_focus_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..22f47e3e4191f22a963a1416dc24a64240e12edc
--- /dev/null
+++ b/ui/base/ime/text_input_focus_manager.h
@@ -0,0 +1,47 @@
+// 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.
+
+#ifndef UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_
+#define UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_
+
+#include "base/macros.h"
+#include "base/threading/thread_checker.h"
+#include "ui/base/ui_base_export.h"
+
+template <typename T> struct DefaultSingletonTraits;
+
+namespace ui {
+
+class TextInputClient;
+
+// Manages the focused TextInputClient across windows and their contents.
+class UI_BASE_EXPORT TextInputFocusManager {
+ public:
+ static TextInputFocusManager* GetInstance();
+
+ // Returns the currently focused text input client or NULL.
+ TextInputClient* GetFocusedTextInputClient();
+
+ // Changes the text input focus to |text_input_client|.
+ void FocusTextInputClient(TextInputClient* text_input_client);
+
+ // Removes the text input focus from |text_input_client|. If
+ // |text_input_client| was not focused, does nothing.
+ void BlurTextInputClient(TextInputClient* text_input_client);
+
+ private:
+ friend struct DefaultSingletonTraits<TextInputFocusManager>;
+
+ TextInputFocusManager();
+ ~TextInputFocusManager();
+
+ TextInputClient* focused_text_input_client_;
+ base::ThreadChecker thread_checker_;
+
+ DISALLOW_COPY_AND_ASSIGN(TextInputFocusManager);
+};
+
+} // namespace ui
+
+#endif // UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_
« no previous file with comments | « ui/base/ime/input_method_base.cc ('k') | ui/base/ime/text_input_focus_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698