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/extensions/input_method_api.h" | 5 #include "chrome/browser/chromeos/extensions/input_method_api.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/chromeos/extensions/input_method_event_router.h" | 10 #include "chrome/browser/chromeos/extensions/input_method_event_router.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 namespace extensions { | 28 namespace extensions { |
29 | 29 |
30 ExtensionFunction::ResponseAction GetInputMethodConfigFunction::Run() { | 30 ExtensionFunction::ResponseAction GetInputMethodConfigFunction::Run() { |
31 #if !defined(OS_CHROMEOS) | 31 #if !defined(OS_CHROMEOS) |
32 EXTENSION_FUNCTION_VALIDATE(false); | 32 EXTENSION_FUNCTION_VALIDATE(false); |
33 #else | 33 #else |
34 base::DictionaryValue* output = new base::DictionaryValue(); | 34 base::DictionaryValue* output = new base::DictionaryValue(); |
35 output->SetBoolean( | 35 output->SetBoolean( |
36 "isPhysicalKeyboardAutocorrectEnabled", | 36 "isPhysicalKeyboardAutocorrectEnabled", |
37 CommandLine::ForCurrentProcess()->HasSwitch( | 37 base::CommandLine::ForCurrentProcess()->HasSwitch( |
38 chromeos::switches::kEnablePhysicalKeyboardAutocorrect)); | 38 chromeos::switches::kEnablePhysicalKeyboardAutocorrect)); |
39 output->SetBoolean( | 39 output->SetBoolean("isNewQPInputViewEnabled", |
40 "isNewQPInputViewEnabled", | 40 base::CommandLine::ForCurrentProcess()->HasSwitch( |
41 CommandLine::ForCurrentProcess()->HasSwitch( | 41 chromeos::switches::kEnableNewQPInputView)); |
42 chromeos::switches::kEnableNewQPInputView)); | |
43 return RespondNow(OneArgument(output)); | 42 return RespondNow(OneArgument(output)); |
44 #endif | 43 #endif |
45 } | 44 } |
46 | 45 |
47 ExtensionFunction::ResponseAction GetCurrentInputMethodFunction::Run() { | 46 ExtensionFunction::ResponseAction GetCurrentInputMethodFunction::Run() { |
48 #if !defined(OS_CHROMEOS) | 47 #if !defined(OS_CHROMEOS) |
49 EXTENSION_FUNCTION_VALIDATE(false); | 48 EXTENSION_FUNCTION_VALIDATE(false); |
50 #else | 49 #else |
51 chromeos::input_method::InputMethodManager* manager = | 50 chromeos::input_method::InputMethodManager* manager = |
52 chromeos::input_method::InputMethodManager::Get(); | 51 chromeos::input_method::InputMethodManager::Get(); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 static base::LazyInstance<BrowserContextKeyedAPIFactory<InputMethodAPI> > | 144 static base::LazyInstance<BrowserContextKeyedAPIFactory<InputMethodAPI> > |
146 g_factory = LAZY_INSTANCE_INITIALIZER; | 145 g_factory = LAZY_INSTANCE_INITIALIZER; |
147 | 146 |
148 // static | 147 // static |
149 BrowserContextKeyedAPIFactory<InputMethodAPI>* | 148 BrowserContextKeyedAPIFactory<InputMethodAPI>* |
150 InputMethodAPI::GetFactoryInstance() { | 149 InputMethodAPI::GetFactoryInstance() { |
151 return g_factory.Pointer(); | 150 return g_factory.Pointer(); |
152 } | 151 } |
153 | 152 |
154 } // namespace extensions | 153 } // namespace extensions |
OLD | NEW |