| 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 | |
| 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 Loading... |
| 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 |
| OLD | NEW |