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

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, 9 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
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..54d66944c8c370822f5bef2f4bd2afbc1f6d89af
--- /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 "ui/base/ui_base_export.h"
+
+template <typename T> struct DefaultSingletonTraits;
+
+namespace ui {
+
+class TextInputClient;
+
+// 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.
+// has the text input focus.
+class UI_BASE_EXPORT TextInputFocusManager {
+ public:
+ 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.
+
+ static TextInputFocusManager* GetInstance();
+
+ // Returns the currently focused text input client or NULL.
+ TextInputClient* GetFocusedTextInputClient();
+
+ // Changes the text input focus to |text_input_client|.
+ void SetFocusedTextInputClient(TextInputClient* text_input_client);
msw 2014/03/11 00:58:50 nit: consider "FocusTextInputClient"
Yuki 2014/03/11 15:27:37 Done.
+
+ // Removes the text input focus from |text_input_client|. If
+ // |text_input_client| was not focused, does nothing.
+ 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.
+
+ private:
+ TextInputFocusManager();
+
+ 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.
+
+ 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.
+
+ DISALLOW_COPY_AND_ASSIGN(TextInputFocusManager);
+};
+
+} // namespace ui
+
+#endif // UI_BASE_IME_TEXT_INPUT_FOCUS_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698