| 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 #include "ui/base/ime/remote_input_method_win.h" | 5 #include "ui/base/ime/remote_input_method_win.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/observer_list.h" | 8 #include "base/observer_list.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "base/win/metro.h" | 10 #include "base/win/metro.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 g_private_interface_ = NULL; | 53 g_private_interface_ = NULL; |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 std::string GetLocaleString(LCID Locale_id, LCTYPE locale_type) { | 57 std::string GetLocaleString(LCID Locale_id, LCTYPE locale_type) { |
| 58 wchar_t buffer[16] = {}; | 58 wchar_t buffer[16] = {}; |
| 59 | 59 |
| 60 //|chars_written| includes NUL terminator. | 60 //|chars_written| includes NUL terminator. |
| 61 const int chars_written = | 61 const int chars_written = |
| 62 GetLocaleInfo(Locale_id, locale_type, buffer, arraysize(buffer)); | 62 GetLocaleInfo(Locale_id, locale_type, buffer, arraysize(buffer)); |
| 63 if (chars_written <= 1 || arraysize(buffer) < chars_written) | 63 if (chars_written <= 1 || static_cast<int>(arraysize(buffer)) < chars_written) |
| 64 return std::string(); | 64 return std::string(); |
| 65 std::string result; | 65 std::string result; |
| 66 base::WideToUTF8(buffer, chars_written - 1, &result); | 66 base::WideToUTF8(buffer, chars_written - 1, &result); |
| 67 return result; | 67 return result; |
| 68 } | 68 } |
| 69 | 69 |
| 70 std::vector<int32> GetInputScopesAsInt(TextInputType text_input_type, | 70 std::vector<int32> GetInputScopesAsInt(TextInputType text_input_type, |
| 71 TextInputMode text_input_mode) { | 71 TextInputMode text_input_mode) { |
| 72 std::vector<int32> result; | 72 std::vector<int32> result; |
| 73 // An empty vector represents |text_input_type| is TEXT_INPUT_TYPE_NONE. | 73 // An empty vector represents |text_input_type| is TEXT_INPUT_TYPE_NONE. |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 return make_scoped_ptr(new RemoteInputMethodWin(delegate)); | 374 return make_scoped_ptr(new RemoteInputMethodWin(delegate)); |
| 375 } | 375 } |
| 376 | 376 |
| 377 // static | 377 // static |
| 378 RemoteInputMethodPrivateWin* RemoteInputMethodPrivateWin::Get( | 378 RemoteInputMethodPrivateWin* RemoteInputMethodPrivateWin::Get( |
| 379 InputMethod* input_method) { | 379 InputMethod* input_method) { |
| 380 return GetPrivate(input_method); | 380 return GetPrivate(input_method); |
| 381 } | 381 } |
| 382 | 382 |
| 383 } // namespace ui | 383 } // namespace ui |
| OLD | NEW |