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

Side by Side Diff: ui/views/mus/input_method_mus.cc

Issue 2374883002: views/mus: Change 'reset(new' to base::MakeUnqiue. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « ui/views/mus/clipboard_mus.cc ('k') | ui/views/mus/input_method_mus_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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> 7 #include <utility>
8 8
9 #include "services/ui/public/cpp/window.h" 9 #include "services/ui/public/cpp/window.h"
10 #include "services/ui/public/interfaces/ime.mojom.h" 10 #include "services/ui/public/interfaces/ime.mojom.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // mean for displaying candidate list popup. 107 // mean for displaying candidate list popup.
108 return false; 108 return false;
109 } 109 }
110 110
111 void InputMethodMus::OnDidChangeFocusedClient( 111 void InputMethodMus::OnDidChangeFocusedClient(
112 ui::TextInputClient* focused_before, 112 ui::TextInputClient* focused_before,
113 ui::TextInputClient* focused) { 113 ui::TextInputClient* focused) {
114 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused); 114 InputMethodBase::OnDidChangeFocusedClient(focused_before, focused);
115 UpdateTextInputType(); 115 UpdateTextInputType();
116 116
117 text_input_client_.reset(new TextInputClientImpl(focused, this)); 117 text_input_client_ = base::MakeUnique<TextInputClientImpl>(focused, this);
118 ime_server_->StartSession(text_input_client_->CreateInterfacePtrAndBind(), 118 ime_server_->StartSession(text_input_client_->CreateInterfacePtrAndBind(),
119 GetProxy(&input_method_)); 119 GetProxy(&input_method_));
120 } 120 }
121 121
122 void InputMethodMus::UpdateTextInputType() { 122 void InputMethodMus::UpdateTextInputType() {
123 ui::TextInputType type = GetTextInputType(); 123 ui::TextInputType type = GetTextInputType();
124 mojo::TextInputStatePtr state = mojo::TextInputState::New(); 124 mojo::TextInputStatePtr state = mojo::TextInputState::New();
125 state->type = mojo::ConvertTo<mojo::TextInputType>(type); 125 state->type = mojo::ConvertTo<mojo::TextInputType>(type);
126 if (window_) { 126 if (window_) {
127 if (type != ui::TEXT_INPUT_TYPE_NONE) 127 if (type != ui::TEXT_INPUT_TYPE_NONE)
128 window_->SetImeVisibility(true, std::move(state)); 128 window_->SetImeVisibility(true, std::move(state));
129 else 129 else
130 window_->SetTextInputState(std::move(state)); 130 window_->SetTextInputState(std::move(state));
131 } 131 }
132 } 132 }
133 133
134 } // namespace views 134 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/mus/clipboard_mus.cc ('k') | ui/views/mus/input_method_mus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698