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 "chrome/browser/chromeos/input_method/input_method_delegate_impl.h" | 5 #include "chrome/browser/chromeos/input_method/input_method_delegate_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/prefs/pref_service.h" |
8 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/prefs/pref_service.h" | |
10 #include "chrome/common/pref_names.h" | 10 #include "chrome/common/pref_names.h" |
11 | 11 |
12 namespace chromeos { | 12 namespace chromeos { |
13 namespace input_method { | 13 namespace input_method { |
14 | 14 |
15 InputMethodDelegateImpl::InputMethodDelegateImpl() {} | 15 InputMethodDelegateImpl::InputMethodDelegateImpl() {} |
16 | 16 |
17 std::string InputMethodDelegateImpl::GetHardwareKeyboardLayout() const { | 17 std::string InputMethodDelegateImpl::GetHardwareKeyboardLayout() const { |
18 if (g_browser_process) { | 18 if (g_browser_process) { |
19 PrefServiceBase* local_state = g_browser_process->local_state(); | 19 PrefServiceBase* local_state = g_browser_process->local_state(); |
20 if (local_state) | 20 if (local_state) |
21 return local_state->GetString(prefs::kHardwareKeyboardLayout); | 21 return local_state->GetString(prefs::kHardwareKeyboardLayout); |
22 } | 22 } |
23 // This shouldn't happen but just in case. | 23 // This shouldn't happen but just in case. |
24 DVLOG(1) << "Local state is not yet ready."; | 24 DVLOG(1) << "Local state is not yet ready."; |
25 return std::string(); | 25 return std::string(); |
26 } | 26 } |
27 | 27 |
28 std::string InputMethodDelegateImpl::GetActiveLocale() const { | 28 std::string InputMethodDelegateImpl::GetActiveLocale() const { |
29 if (g_browser_process) | 29 if (g_browser_process) |
30 return g_browser_process->GetApplicationLocale(); | 30 return g_browser_process->GetApplicationLocale(); |
31 | 31 |
32 NOTREACHED(); | 32 NOTREACHED(); |
33 return std::string(); | 33 return std::string(); |
34 } | 34 } |
35 | 35 |
36 } // namespace input_method | 36 } // namespace input_method |
37 } // namespace chromeos | 37 } // namespace chromeos |
OLD | NEW |