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

Unified Diff: views/ime/input_method_manager.h

Issue 7217008: Use input method to control visibility of virtual keyboard (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Update Created 9 years, 5 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: views/ime/input_method_manager.h
diff --git a/views/ime/input_method_manager.h b/views/ime/input_method_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..6f59ff6610955a783e199c4cc3cc3ce54a687c67
--- /dev/null
+++ b/views/ime/input_method_manager.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2011 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 VIEWS_IME_INPUT_METHOD_MANAGER_H_
+#define VIEWS_IME_INPUT_METHOD_MANAGER_H_
+#pragma once
+
+#include "base/memory/singleton.h"
+#include "base/observer_list.h"
+#include "ui/base/ime/text_input_type.h"
+
+namespace views {
+
+class View;
James Su 2011/07/07 02:03:03 nit: remove this line.
Peng 2011/07/07 17:56:54 Done.
+class Widget;
+
+class TextInputTypeChangedListener {
James Su 2011/07/07 02:03:03 nit: How about call it TextInputTypeObserver? And
Peng 2011/07/07 17:56:54 Done.
+ public:
+ virtual void TextInputTypeChanged(ui::TextInputType type, Widget* widget) = 0;
James Su 2011/07/07 02:03:03 nit: Add some comment? e.g. clarify in what situat
Peng 2011/07/07 17:56:54 Done.
+
+ protected:
+ virtual ~TextInputTypeChangedListener() {}
+};
+
+class InputMethodManager {
James Su 2011/07/07 02:03:03 How about to rename this class to something more s
+ public:
+ // Returns the singleton instance.
+ static InputMethodManager* GetInstance();
+
+ // Adds/removes a TextInputTypeChangedListener |listener| to the set of
+ // active listeners.
+ void AddTextInputTypeChangedListener(TextInputTypeChangedListener* listener);
James Su 2011/07/07 02:03:03 nit: AddTextInputTypeObserver(...);
Peng 2011/07/07 17:56:54 Done.
+ void RemoveTextInputTypeChangedListener(
James Su 2011/07/07 02:03:03 ditto
Peng 2011/07/07 17:56:54 Done.
+ TextInputTypeChangedListener* listener);
+
+ void OnTextInputTypeChanged(ui::TextInputType type, Widget* widget);
James Su 2011/07/07 02:03:03 nit: add comment to clarify whom will call this me
Peng 2011/07/07 17:56:54 Done.
+
+ private:
+ InputMethodManager();
+ ~InputMethodManager();
+
+ ObserverList<TextInputTypeChangedListener> text_input_type_changed_listeners_;
+
+ friend struct DefaultSingletonTraits<InputMethodManager>;
+ DISALLOW_COPY_AND_ASSIGN(InputMethodManager);
+};
+
+} // namespace views
+
+#endif // VIEWS_IME_INPUT_METHOD_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698