| 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 "ui/base/ime/input_method_factory.h" | 5 #include "ui/base/ime/input_method_factory.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "ui/base/ime/mock_input_method.h" | 9 #include "ui/base/ime/mock_input_method.h" |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 return base::MakeUnique<InputMethodAndroid>(delegate); | 61 return base::MakeUnique<InputMethodAndroid>(delegate); |
| 62 #else | 62 #else |
| 63 return base::MakeUnique<InputMethodMinimal>(delegate); | 63 return base::MakeUnique<InputMethodMinimal>(delegate); |
| 64 #endif | 64 #endif |
| 65 } | 65 } |
| 66 | 66 |
| 67 void SetUpInputMethodFactoryForTesting() { | 67 void SetUpInputMethodFactoryForTesting() { |
| 68 if (g_input_method_set_for_testing) | 68 if (g_input_method_set_for_testing) |
| 69 return; | 69 return; |
| 70 | 70 |
| 71 CHECK(!g_create_input_method_called) | 71 // ui::SetUpInputMethodFactoryForTesting was called after use of |
| 72 << "ui::SetUpInputMethodFactoryForTesting was called after use of " | 72 // ui::CreateInputMethod. You must call ui::SetUpInputMethodFactoryForTesting |
| 73 << "ui::CreateInputMethod. You must call " | 73 // earlier. |
| 74 << "ui::SetUpInputMethodFactoryForTesting earlier."; | 74 CHECK(!g_create_input_method_called); |
| 75 | 75 |
| 76 g_input_method_set_for_testing = true; | 76 g_input_method_set_for_testing = true; |
| 77 } | 77 } |
| 78 | 78 |
| 79 void SetUpInputMethodForTesting(InputMethod* input_method) { | 79 void SetUpInputMethodForTesting(InputMethod* input_method) { |
| 80 g_input_method_for_testing = input_method; | 80 g_input_method_for_testing = input_method; |
| 81 } | 81 } |
| 82 | 82 |
| 83 } // namespace ui | 83 } // namespace ui |
| OLD | NEW |