| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/cros/input_method_library.h" | 5 #include "chrome/browser/chromeos/cros/input_method_library.h" |
| 6 | 6 |
| 7 #include <glib.h> |
| 8 #include <signal.h> |
| 9 |
| 10 #include "unicode/uloc.h" |
| 11 |
| 7 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 8 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 9 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 10 #include "chrome/browser/chrome_thread.h" | 15 #include "chrome/browser/chrome_thread.h" |
| 11 #include "chrome/browser/chromeos/cros/cros_library.h" | 16 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 12 #include "chrome/browser/chromeos/cros/keyboard_library.h" | 17 #include "chrome/browser/chromeos/cros/keyboard_library.h" |
| 13 #include "chrome/browser/chromeos/language_preferences.h" | 18 #include "chrome/browser/chromeos/language_preferences.h" |
| 14 #include "third_party/icu/public/common/unicode/uloc.h" | |
| 15 | |
| 16 #include <glib.h> | |
| 17 #include <signal.h> | |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 | 21 |
| 21 // Finds a property which has |new_prop.key| from |prop_list|, and replaces the | 22 // Finds a property which has |new_prop.key| from |prop_list|, and replaces the |
| 22 // property with |new_prop|. Returns true if such a property is found. | 23 // property with |new_prop|. Returns true if such a property is found. |
| 23 bool FindAndUpdateProperty(const chromeos::ImeProperty& new_prop, | 24 bool FindAndUpdateProperty(const chromeos::ImeProperty& new_prop, |
| 24 chromeos::ImePropertyList* prop_list) { | 25 chromeos::ImePropertyList* prop_list) { |
| 25 for (size_t i = 0; i < prop_list->size(); ++i) { | 26 for (size_t i = 0; i < prop_list->size(); ++i) { |
| 26 chromeos::ImeProperty& prop = prop_list->at(i); | 27 chromeos::ImeProperty& prop = prop_list->at(i); |
| 27 if (prop.key == new_prop.key) { | 28 if (prop.key == new_prop.key) { |
| (...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 return new InputMethodLibraryStubImpl(); | 698 return new InputMethodLibraryStubImpl(); |
| 698 else | 699 else |
| 699 return new InputMethodLibraryImpl(); | 700 return new InputMethodLibraryImpl(); |
| 700 } | 701 } |
| 701 | 702 |
| 702 } // namespace chromeos | 703 } // namespace chromeos |
| 703 | 704 |
| 704 // Allows InvokeLater without adding refcounting. This class is a Singleton and | 705 // Allows InvokeLater without adding refcounting. This class is a Singleton and |
| 705 // won't be deleted until it's last InvokeLater is run. | 706 // won't be deleted until it's last InvokeLater is run. |
| 706 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::InputMethodLibraryImpl); | 707 DISABLE_RUNNABLE_METHOD_REFCOUNT(chromeos::InputMethodLibraryImpl); |
| OLD | NEW |