OLD | NEW |
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 Loading... |
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 |
501 // TODO(nona): Return false if there is ongoing composition. | 504 // TODO(nona): Return false if there is ongoing composition. |
502 | 505 |
503 IMEInputContextHandlerInterface* input_context = | 506 IMEInputContextHandlerInterface* input_context = |
504 IMEBridge::Get()->GetInputContextHandler(); | 507 IMEBridge::Get()->GetInputContextHandler(); |
505 if (input_context) | 508 if (input_context) |
506 input_context->DeleteSurroundingText(offset, number_of_chars); | 509 input_context->DeleteSurroundingText(offset, number_of_chars); |
507 | 510 |
508 return true; | 511 return true; |
509 } | 512 } |
510 | 513 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 // TODO(nona): Implement it. | 703 // TODO(nona): Implement it. |
701 break; | 704 break; |
702 } | 705 } |
703 } | 706 } |
704 } | 707 } |
705 | 708 |
706 // TODO(nona): Support item.children. | 709 // TODO(nona): Support item.children. |
707 } | 710 } |
708 | 711 |
709 } // namespace chromeos | 712 } // namespace chromeos |
OLD | NEW |