Chromium Code Reviews| Index: views/ime/text_input_type_tracker.cc |
| diff --git a/views/ime/text_input_type_tracker.cc b/views/ime/text_input_type_tracker.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..eb4264d52a68de9cb42494b640ae52746612b6e1 |
| --- /dev/null |
| +++ b/views/ime/text_input_type_tracker.cc |
| @@ -0,0 +1,37 @@ |
| +// 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. |
| + |
| +#include "views/ime/text_input_type_tracker.h" |
| + |
| +namespace views { |
| + |
| +void TextInputTypeTracker::AddTextInputTypeObserver( |
| + TextInputTypeObserver* observer) { |
| + text_input_type_observers_.AddObserver(observer); |
| +} |
| + |
| +void TextInputTypeTracker::RemoveTextInputTypeObserver( |
| + TextInputTypeObserver* observer) { |
| + text_input_type_observers_.RemoveObserver(observer); |
| +} |
| + |
| +void TextInputTypeTracker::OnTextInputTypeChanged(ui::TextInputType type, |
|
James Su
2011/07/11 01:36:37
nit: align arguments.
Peng
2011/07/11 14:43:03
Done.
|
| + Widget* widget) { |
| + FOR_EACH_OBSERVER(TextInputTypeObserver, |
| + text_input_type_observers_, |
| + TextInputTypeChanged(type, widget)); |
| +} |
| + |
| +TextInputTypeTracker::TextInputTypeTracker() { |
| +} |
| + |
| +TextInputTypeTracker::~TextInputTypeTracker() { |
| +} |
| + |
| +// static |
| +TextInputTypeTracker* TextInputTypeTracker::GetInstance() { |
| + return Singleton<TextInputTypeTracker>::get(); |
| +} |
| + |
| +} // namespace views |