Chromium Code Reviews| 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_ |