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

Side by Side Diff: views/ime/input_method.cc

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, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/ime/input_method.h ('k') | views/ime/input_method_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "views/ime/input_method.h"
6
7 #include <algorithm>
8
9 #include "base/logging.h"
10
11 namespace views {
12
Peng 2011/06/21 15:42:53 Hi Suzhe, I added some functions into InputMethod
13 void InputMethod::AddTextInputTypeChangedListener(
14 TextInputTypeChangedListener* listener) {
15 DCHECK(std::find(text_input_type_changed_listeners_.begin(),
16 text_input_type_changed_listeners_.end(), listener) ==
17 text_input_type_changed_listeners_.end()) << "Adding a listener twice.";
18 text_input_type_changed_listeners_.push_back(listener);
19 }
20
21 void InputMethod::RemoveTextInputTypeChangedListener(
22 TextInputTypeChangedListener* listener) {
23 TextInputTypeChangedListenerList::iterator place =
24 std::find(text_input_type_changed_listeners_.begin(),
25 text_input_type_changed_listeners_.end(),
26 listener);
27 if (place == text_input_type_changed_listeners_.end()) {
28 NOTREACHED() << "Removing a listener that isn't registered.";
29 return;
30 }
31 text_input_type_changed_listeners_.erase(place);
32 }
33
34 void InputMethod::TextInputTypeChanged(View *view) {
35 TextInputTypeChangedListenerList::const_iterator iter;
36 for (iter = text_input_type_changed_listeners_.begin();
37 iter != text_input_type_changed_listeners_.end(); ++iter) {
38 (*iter)->TextInputTypeChanged(view, GetTextInputType());
39 }
40 }
41
42 } // namespace views
OLDNEW
« no previous file with comments | « views/ime/input_method.h ('k') | views/ime/input_method_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698