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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_engine.cc

Issue 868663005: Revert of Revert of Add support for deleting non preceeding surrounding text in chrome.input.ime.deleteSurroundingText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | ui/base/ime/input_method_chromeos.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/chromeos/input_method/input_method_engine.h" 5 #include "chrome/browser/chromeos/input_method/input_method_engine.h"
6 6
7 #undef FocusIn 7 #undef FocusIn
8 #undef FocusOut 8 #undef FocusOut
9 #undef RootWindow 9 #undef RootWindow
10 #include <map> 10 #include <map>
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 std::string* error) { 491 std::string* error) {
492 if (!IsActive()) { 492 if (!IsActive()) {
493 *error = kErrorNotActive; 493 *error = kErrorNotActive;
494 return false; 494 return false;
495 } 495 }
496 if (context_id != context_id_ || context_id_ == -1) { 496 if (context_id != context_id_ || context_id_ == -1) {
497 *error = kErrorWrongContext; 497 *error = kErrorWrongContext;
498 return false; 498 return false;
499 } 499 }
500 500
501 if (offset < 0 && static_cast<size_t>(-1 * offset) != size_t(number_of_chars))
502 return false; // Currently we can only support preceding text.
503
504 // TODO(nona): Return false if there is ongoing composition. 501 // TODO(nona): Return false if there is ongoing composition.
505 502
506 IMEInputContextHandlerInterface* input_context = 503 IMEInputContextHandlerInterface* input_context =
507 IMEBridge::Get()->GetInputContextHandler(); 504 IMEBridge::Get()->GetInputContextHandler();
508 if (input_context) 505 if (input_context)
509 input_context->DeleteSurroundingText(offset, number_of_chars); 506 input_context->DeleteSurroundingText(offset, number_of_chars);
510 507
511 return true; 508 return true;
512 } 509 }
513 510
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 // TODO(nona): Implement it. 700 // TODO(nona): Implement it.
704 break; 701 break;
705 } 702 }
706 } 703 }
707 } 704 }
708 705
709 // TODO(nona): Support item.children. 706 // TODO(nona): Support item.children.
710 } 707 }
711 708
712 } // namespace chromeos 709 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | ui/base/ime/input_method_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698