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

Side by Side Diff: components/arc/ime/arc_ime_bridge_impl.cc

Issue 2876693004: Implement GetTextFromRange(), GetTextRange() and GetSelectionRange() for ArcImeService. (Closed)
Patch Set: save surrounding text even if cursor rect is not changed Created 3 years, 7 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/arc/ime/arc_ime_bridge_impl.h" 5 #include "components/arc/ime/arc_ime_bridge_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 149
150 void ArcImeBridgeImpl::OnCancelComposition() { 150 void ArcImeBridgeImpl::OnCancelComposition() {
151 delegate_->OnCancelComposition(); 151 delegate_->OnCancelComposition();
152 } 152 }
153 153
154 void ArcImeBridgeImpl::ShowImeIfNeeded() { 154 void ArcImeBridgeImpl::ShowImeIfNeeded() {
155 delegate_->ShowImeIfNeeded(); 155 delegate_->ShowImeIfNeeded();
156 } 156 }
157 157
158 void ArcImeBridgeImpl::OnCursorRectChangedWithSurroundingText(
159 mojom::CursorRectPtr rect,
160 mojom::TextRangePtr text_range,
161 const std::string& text_in_range,
162 mojom::TextRangePtr selection_range) {
163 delegate_->OnCursorRectChangedWithSurroundingText(
164 gfx::Rect(rect->left, rect->top, rect->right - rect->left,
165 rect->bottom - rect->top),
166 gfx::Range(text_range->start, text_range->end),
167 base::UTF8ToUTF16(text_in_range),
168 gfx::Range(selection_range->start, selection_range->end));
169 }
170
158 } // namespace arc 171 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698