| 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 // This file contains utility functions for locale change. | 5 // This file contains utility functions for locale change. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_CHROMEOS_BASE_LOCALE_UTIL_H_ | 7 #ifndef CHROME_BROWSER_CHROMEOS_BASE_LOCALE_UTIL_H_ |
| 8 #define CHROME_BROWSER_CHROMEOS_BASE_LOCALE_UTIL_H_ | 8 #define CHROME_BROWSER_CHROMEOS_BASE_LOCALE_UTIL_H_ |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 | 13 |
| 14 class Profile; |
| 15 |
| 14 namespace base { | 16 namespace base { |
| 15 | 17 |
| 16 template <typename T> | 18 template <typename T> |
| 17 class Callback; | 19 class Callback; |
| 18 | 20 |
| 19 } // namespace base | 21 } // namespace base |
| 20 | 22 |
| 21 namespace chromeos { | 23 namespace chromeos { |
| 22 namespace locale_util { | 24 namespace locale_util { |
| 23 | 25 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 35 // completed on BlockingPool. | 37 // completed on BlockingPool. |
| 36 // |result| contains: | 38 // |result| contains: |
| 37 // locale - (copy of) locale argument to SwitchLanguage(). Expected locale. | 39 // locale - (copy of) locale argument to SwitchLanguage(). Expected locale. |
| 38 // loaded_locale - actual locale name loaded. | 40 // loaded_locale - actual locale name loaded. |
| 39 // success - if locale load succeeded. | 41 // success - if locale load succeeded. |
| 40 // (const std::string* locale, const std::string* loaded_locale, bool success) | 42 // (const std::string* locale, const std::string* loaded_locale, bool success) |
| 41 typedef base::Callback<void(const LanguageSwitchResult& result)> | 43 typedef base::Callback<void(const LanguageSwitchResult& result)> |
| 42 SwitchLanguageCallback; | 44 SwitchLanguageCallback; |
| 43 | 45 |
| 44 // This function updates input methods only if requested. In general, you want | 46 // This function updates input methods only if requested. In general, you want |
| 45 // |enable_locale_keyboard_layouts = true|. | 47 // |enable_locale_keyboard_layouts = true|. |profile| is needed because IME |
| 48 // extensions are per-user. |
| 46 // Note: in case of |enable_locale_keyboard_layouts = false|, the input method | 49 // Note: in case of |enable_locale_keyboard_layouts = false|, the input method |
| 47 // currently in use may not be supported by the new locale. Using the new locale | 50 // currently in use may not be supported by the new locale. Using the new locale |
| 48 // with an unsupported input method may lead to undefined behavior. Use | 51 // with an unsupported input method may lead to undefined behavior. Use |
| 49 // |enable_locale_keyboard_layouts = false| with caution. | 52 // |enable_locale_keyboard_layouts = false| with caution. |
| 50 // Note 2: |login_layouts_only = true| enables only login-capable layouts. | 53 // Note 2: |login_layouts_only = true| enables only login-capable layouts. |
| 51 void SwitchLanguage(const std::string& locale, | 54 void SwitchLanguage(const std::string& locale, |
| 52 const bool enable_locale_keyboard_layouts, | 55 const bool enable_locale_keyboard_layouts, |
| 53 const bool login_layouts_only, | 56 const bool login_layouts_only, |
| 54 const SwitchLanguageCallback& callback); | 57 const SwitchLanguageCallback& callback, |
| 58 Profile* profile); |
| 55 | 59 |
| 56 } // namespace locale_util | 60 } // namespace locale_util |
| 57 } // namespace chromeos | 61 } // namespace chromeos |
| 58 | 62 |
| 59 #endif // CHROME_BROWSER_CHROMEOS_BASE_LOCALE_UTIL_H_ | 63 #endif // CHROME_BROWSER_CHROMEOS_BASE_LOCALE_UTIL_H_ |
| OLD | NEW |