| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/character_composer.h" | 5 #include "ui/base/ime/character_composer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 | 9 |
| 10 #include "base/third_party/icu/icu_utf.h" | 10 #include "base/third_party/icu/icu_utf.h" |
| 11 #include "base/utf_string_conversions.h" | 11 #include "base/utf_string_conversions.h" |
| 12 // Note for Gtk removal: gdkkeysyms.h only contains a set of | 12 // Note for Gtk removal: gdkkeysyms.h only contains a set of |
| 13 // '#define GDK_KeyName 0xNNNN' macros and does not #include any Gtk headers. | 13 // '#define GDK_KeyName 0xNNNN' macros and does not #include any Gtk headers. |
| 14 #include "third_party/gtk+/gdk/gdkkeysyms.h" | 14 #include "third_party/gtk+/gdk/gdkkeysyms.h" |
| 15 #include "ui/base/events.h" | 15 #include "ui/base/events/event_constants.h" |
| 16 #include "ui/base/glib/glib_integers.h" | 16 #include "ui/base/glib/glib_integers.h" |
| 17 | 17 |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 typedef std::vector<unsigned int> ComposeBufferType; | 20 typedef std::vector<unsigned int> ComposeBufferType; |
| 21 | 21 |
| 22 // An iterator class to apply std::lower_bound for composition table. | 22 // An iterator class to apply std::lower_bound for composition table. |
| 23 class SequenceIterator | 23 class SequenceIterator |
| 24 : public std::iterator<std::random_access_iterator_tag, const uint16*> { | 24 : public std::iterator<std::random_access_iterator_tag, const uint16*> { |
| 25 public: | 25 public: |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 std::string preedit_string_ascii("u"); | 492 std::string preedit_string_ascii("u"); |
| 493 for (size_t i = 0; i != compose_buffer_.size(); ++i) { | 493 for (size_t i = 0; i != compose_buffer_.size(); ++i) { |
| 494 const int digit = compose_buffer_[i]; | 494 const int digit = compose_buffer_[i]; |
| 495 DCHECK(0 <= digit && digit < 16); | 495 DCHECK(0 <= digit && digit < 16); |
| 496 preedit_string_ascii += digit <= 9 ? ('0' + digit) : ('a' + (digit - 10)); | 496 preedit_string_ascii += digit <= 9 ? ('0' + digit) : ('a' + (digit - 10)); |
| 497 } | 497 } |
| 498 preedit_string_ = ASCIIToUTF16(preedit_string_ascii); | 498 preedit_string_ = ASCIIToUTF16(preedit_string_ascii); |
| 499 } | 499 } |
| 500 | 500 |
| 501 } // namespace ui | 501 } // namespace ui |
| OLD | NEW |