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

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

Issue 739323002: Requests for tabs permission for VirtualKeyboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/base/ime/dummy_text_input_client.cc ('k') | ui/base/ime/text_input_client.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_chromeos.h" 5 #include "ui/base/ime/input_method_chromeos.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cstring> 8 #include <cstring>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 return; 234 return;
235 } 235 }
236 236
237 // Here SetSurroundingText accepts relative position of |surrounding_text|, so 237 // Here SetSurroundingText accepts relative position of |surrounding_text|, so
238 // we have to convert |selection_range| from node coordinates to 238 // we have to convert |selection_range| from node coordinates to
239 // |surrounding_text| coordinates. 239 // |surrounding_text| coordinates.
240 if (!GetEngine()) 240 if (!GetEngine())
241 return; 241 return;
242 GetEngine()->SetSurroundingText(base::UTF16ToUTF8(surrounding_text), 242 GetEngine()->SetSurroundingText(base::UTF16ToUTF8(surrounding_text),
243 selection_range.start() - text_range.start(), 243 selection_range.start() - text_range.start(),
244 selection_range.end() - text_range.start()); 244 selection_range.end() - text_range.start(),
245 client->GetSelectionOffset());
245 } 246 }
246 247
247 void InputMethodChromeOS::CancelComposition(const TextInputClient* client) { 248 void InputMethodChromeOS::CancelComposition(const TextInputClient* client) {
248 if (IsNonPasswordInputFieldFocused() && IsTextInputClientFocused(client)) 249 if (IsNonPasswordInputFieldFocused() && IsTextInputClientFocused(client))
249 ResetContext(); 250 ResetContext();
250 } 251 }
251 252
252 void InputMethodChromeOS::OnInputLocaleChanged() { 253 void InputMethodChromeOS::OnInputLocaleChanged() {
253 // Not supported. 254 // Not supported.
254 } 255 }
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 bool InputMethodChromeOS::IsNonPasswordInputFieldFocused() { 674 bool InputMethodChromeOS::IsNonPasswordInputFieldFocused() {
674 TextInputType type = GetTextInputType(); 675 TextInputType type = GetTextInputType();
675 return (type != TEXT_INPUT_TYPE_NONE) && (type != TEXT_INPUT_TYPE_PASSWORD); 676 return (type != TEXT_INPUT_TYPE_NONE) && (type != TEXT_INPUT_TYPE_PASSWORD);
676 } 677 }
677 678
678 bool InputMethodChromeOS::IsInputFieldFocused() { 679 bool InputMethodChromeOS::IsInputFieldFocused() {
679 return GetTextInputType() != TEXT_INPUT_TYPE_NONE; 680 return GetTextInputType() != TEXT_INPUT_TYPE_NONE;
680 } 681 }
681 682
682 } // namespace ui 683 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/ime/dummy_text_input_client.cc ('k') | ui/base/ime/text_input_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698