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

Side by Side Diff: ui/base/ime/input_method_base.cc

Issue 1391893003: NOT FOR REVIEW: Aura on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/base/ime/input_method_base.h" 5 #include "ui/base/ime/input_method_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "ui/base/ime/input_method_delegate.h" 10 #include "ui/base/ime/input_method_delegate.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 if (text_input_client_ != client) 46 if (text_input_client_ != client)
47 return; 47 return;
48 SetFocusedTextInputClientInternal(NULL); 48 SetFocusedTextInputClientInternal(NULL);
49 } 49 }
50 50
51 TextInputClient* InputMethodBase::GetTextInputClient() const { 51 TextInputClient* InputMethodBase::GetTextInputClient() const {
52 return system_toplevel_window_focused_ ? text_input_client_ : NULL; 52 return system_toplevel_window_focused_ ? text_input_client_ : NULL;
53 } 53 }
54 54
55 void InputMethodBase::OnTextInputTypeChanged(const TextInputClient* client) { 55 void InputMethodBase::OnTextInputTypeChanged(const TextInputClient* client) {
56 LOG(ERROR) << "auraclank: InputMethodBase::OnTextInputTypeChanged";
56 if (!IsTextInputClientFocused(client)) 57 if (!IsTextInputClientFocused(client))
57 return; 58 return;
58 NotifyTextInputStateChanged(client); 59 NotifyTextInputStateChanged(client);
59 } 60 }
60 61
61 TextInputType InputMethodBase::GetTextInputType() const { 62 TextInputType InputMethodBase::GetTextInputType() const {
62 TextInputClient* client = GetTextInputClient(); 63 TextInputClient* client = GetTextInputClient();
63 return client ? client->GetTextInputType() : TEXT_INPUT_TYPE_NONE; 64 return client ? client->GetTextInputType() : TEXT_INPUT_TYPE_NONE;
64 } 65 }
65 66
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 ui::EventDispatchDetails InputMethodBase::DispatchKeyEventPostIME( 108 ui::EventDispatchDetails InputMethodBase::DispatchKeyEventPostIME(
108 ui::KeyEvent* event) const { 109 ui::KeyEvent* event) const {
109 ui::EventDispatchDetails details; 110 ui::EventDispatchDetails details;
110 if (delegate_) 111 if (delegate_)
111 details = delegate_->DispatchKeyEventPostIME(event); 112 details = delegate_->DispatchKeyEventPostIME(event);
112 return details; 113 return details;
113 } 114 }
114 115
115 void InputMethodBase::NotifyTextInputStateChanged( 116 void InputMethodBase::NotifyTextInputStateChanged(
116 const TextInputClient* client) { 117 const TextInputClient* client) {
118 LOG(ERROR) << "auraclank: InputMethodBase::NotifyTextInputStateChanged";
117 FOR_EACH_OBSERVER(InputMethodObserver, 119 FOR_EACH_OBSERVER(InputMethodObserver,
118 observer_list_, 120 observer_list_,
119 OnTextInputStateChanged(client)); 121 OnTextInputStateChanged(client));
120 } 122 }
121 123
122 void InputMethodBase::NotifyTextInputCaretBoundsChanged( 124 void InputMethodBase::NotifyTextInputCaretBoundsChanged(
123 const TextInputClient* client) { 125 const TextInputClient* client) {
124 FOR_EACH_OBSERVER( 126 FOR_EACH_OBSERVER(
125 InputMethodObserver, observer_list_, OnCaretBoundsChanged(client)); 127 InputMethodObserver, observer_list_, OnCaretBoundsChanged(client));
126 } 128 }
127 129
128 void InputMethodBase::SetFocusedTextInputClientInternal( 130 void InputMethodBase::SetFocusedTextInputClientInternal(
129 TextInputClient* client) { 131 TextInputClient* client) {
130 TextInputClient* old = text_input_client_; 132 TextInputClient* old = text_input_client_;
133 LOG(ERROR) << "auraclank: InputMethodBase::SetFocusedTextInputClientInternal"
134 << ", old=" << old << ", client=" << client;
131 if (old == client) 135 if (old == client)
132 return; 136 return;
133 OnWillChangeFocusedClient(old, client); 137 OnWillChangeFocusedClient(old, client);
134 text_input_client_ = client; // NULL allowed. 138 text_input_client_ = client; // NULL allowed.
135 OnDidChangeFocusedClient(old, client); 139 OnDidChangeFocusedClient(old, client);
136 NotifyTextInputStateChanged(text_input_client_); 140 NotifyTextInputStateChanged(text_input_client_);
137 } 141 }
138 142
139 } // namespace ui 143 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698