OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/aura/mus/input_method_mus.h" | 5 #include "ui/aura/mus/input_method_mus.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "services/ui/public/interfaces/constants.mojom.h" | 9 #include "services/ui/public/interfaces/constants.mojom.h" |
10 #include "services/ui/public/interfaces/ime/ime.mojom.h" | 10 #include "services/ui/public/interfaces/ime/ime.mojom.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 | 120 |
121 void InputMethodMus::OnDidChangeFocusedClient( | 121 void InputMethodMus::OnDidChangeFocusedClient( |
122 ui::TextInputClient* focused_before, | 122 ui::TextInputClient* focused_before, |
123 ui::TextInputClient* focused) { | 123 ui::TextInputClient* focused) { |
124 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused); | 124 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused); |
125 UpdateTextInputType(); | 125 UpdateTextInputType(); |
126 | 126 |
127 text_input_client_ = base::MakeUnique<TextInputClientImpl>(focused); | 127 text_input_client_ = base::MakeUnique<TextInputClientImpl>(focused); |
128 if (ime_server_) { | 128 if (ime_server_) { |
129 ime_server_->StartSession(text_input_client_->CreateInterfacePtrAndBind(), | 129 ime_server_->StartSession(text_input_client_->CreateInterfacePtrAndBind(), |
130 GetProxy(&input_method_)); | 130 MakeRequest(&input_method_)); |
131 } | 131 } |
132 } | 132 } |
133 | 133 |
134 void InputMethodMus::UpdateTextInputType() { | 134 void InputMethodMus::UpdateTextInputType() { |
135 ui::TextInputType type = GetTextInputType(); | 135 ui::TextInputType type = GetTextInputType(); |
136 mojo::TextInputStatePtr state = mojo::TextInputState::New(); | 136 mojo::TextInputStatePtr state = mojo::TextInputState::New(); |
137 state->type = mojo::ConvertTo<mojo::TextInputType>(type); | 137 state->type = mojo::ConvertTo<mojo::TextInputType>(type); |
138 if (window_) { | 138 if (window_) { |
139 WindowPortMus* window_impl_mus = WindowPortMus::Get(window_); | 139 WindowPortMus* window_impl_mus = WindowPortMus::Get(window_); |
140 if (type != ui::TEXT_INPUT_TYPE_NONE) | 140 if (type != ui::TEXT_INPUT_TYPE_NONE) |
(...skipping 20 matching lines...) Expand all Loading... |
161 event_result = EventResult::HANDLED; | 161 event_result = EventResult::HANDLED; |
162 } | 162 } |
163 // |ack_callback| can be null if the standard form of DispatchKeyEvent() is | 163 // |ack_callback| can be null if the standard form of DispatchKeyEvent() is |
164 // called instead of the version which provides a callback. In mus+ash we | 164 // called instead of the version which provides a callback. In mus+ash we |
165 // use the version with callback, but some unittests use the standard form. | 165 // use the version with callback, but some unittests use the standard form. |
166 if (ack_callback) | 166 if (ack_callback) |
167 ack_callback->Run(event_result); | 167 ack_callback->Run(event_result); |
168 } | 168 } |
169 | 169 |
170 } // namespace aura | 170 } // namespace aura |
OLD | NEW |