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/views/mus/input_method_mus.h" | 5 #include "ui/views/mus/input_method_mus.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "components/mus/public/cpp/window.h" | 9 #include "components/mus/public/cpp/window.h" |
8 #include "mojo/converters/ime/ime_type_converters.h" | 10 #include "mojo/converters/ime/ime_type_converters.h" |
9 #include "ui/base/ime/text_input_client.h" | 11 #include "ui/base/ime/text_input_client.h" |
10 #include "ui/events/event.h" | 12 #include "ui/events/event.h" |
11 #include "ui/mojo/ime/text_input_state.mojom.h" | 13 #include "ui/mojo/ime/text_input_state.mojom.h" |
12 | 14 |
13 namespace views { | 15 namespace views { |
14 | 16 |
15 //////////////////////////////////////////////////////////////////////////////// | 17 //////////////////////////////////////////////////////////////////////////////// |
16 // InputMethodMUS, public: | 18 // InputMethodMUS, public: |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 ui::TextInputClient* focused) { | 91 ui::TextInputClient* focused) { |
90 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused); | 92 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused); |
91 UpdateTextInputType(); | 93 UpdateTextInputType(); |
92 } | 94 } |
93 | 95 |
94 void InputMethodMUS::UpdateTextInputType() { | 96 void InputMethodMUS::UpdateTextInputType() { |
95 ui::TextInputType type = GetTextInputType(); | 97 ui::TextInputType type = GetTextInputType(); |
96 mojo::TextInputStatePtr state = mojo::TextInputState::New(); | 98 mojo::TextInputStatePtr state = mojo::TextInputState::New(); |
97 state->type = mojo::ConvertTo<mojo::TextInputType>(type); | 99 state->type = mojo::ConvertTo<mojo::TextInputType>(type); |
98 if (type != ui::TEXT_INPUT_TYPE_NONE) | 100 if (type != ui::TEXT_INPUT_TYPE_NONE) |
99 window_->SetImeVisibility(true, state.Pass()); | 101 window_->SetImeVisibility(true, std::move(state)); |
100 else | 102 else |
101 window_->SetTextInputState(state.Pass()); | 103 window_->SetTextInputState(std::move(state)); |
102 } | 104 } |
103 | 105 |
104 } // namespace mandoline | 106 } // namespace mandoline |
OLD | NEW |