Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / chromeos / base / locale_util.h
blobe260c2015c31c93941fff83d8b133fcae7a84d92
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
3 // found in the LICENSE file.
5 // This file contains utility functions for locale change.
7 #ifndef CHROME_BROWSER_CHROMEOS_BASE_LOCALE_UTIL_H_
8 #define CHROME_BROWSER_CHROMEOS_BASE_LOCALE_UTIL_H_
10 #include <string>
12 #include "base/memory/scoped_ptr.h"
14 namespace base {
16 template <typename T>
17 class Callback;
19 } // namespace base
21 namespace chromeos {
22 namespace locale_util {
24 // This callback is called on UI thread, when ReloadLocaleResources() is
25 // completed on BlockingPool.
26 // Arguments:
27 // locale - (copy of) locale argument to SwitchLanguage(). Expected locale.
28 // loaded_locale - actual locale name loaded.
29 // success - if locale load succeeded.
30 // (const std::string* locale, const std::string* loaded_locale, bool success)
31 typedef base::Callback<void(const std::string&, const std::string&, bool)>
32 SwitchLanguageCallback;
34 // This function updates input methods only if requested. In general you want
35 // "enableLocaleKeyboardLayouts=true".
36 // Note: in case of "enableLocaleKeyboardLayouts=false" the input
37 // method currently in use may not be supported by the new locale. (i.e.
38 // using new locale with unsupported input method may lead to undefined
39 // behavior; use "enableLocaleKeyboardLayouts=false" with caution)
40 void SwitchLanguage(const std::string& locale,
41 bool enableLocaleKeyboardLayouts,
42 scoped_ptr<SwitchLanguageCallback> callback);
44 } // namespace locale_util
45 } // namespace chromeos
47 #endif // CHROME_BROWSER_CHROMEOS_BASE_LOCALE_UTIL_H_