| Index: chrome/browser/chromeos/extensions/input_method_api.cc
|
| diff --git a/chrome/browser/chromeos/extensions/input_method_api.cc b/chrome/browser/chromeos/extensions/input_method_api.cc
|
| index eebcdf050c93863f1a9475b5789580ba13427c94..030f278986b830af17e5e5038792a67a96e1c786 100644
|
| --- a/chrome/browser/chromeos/extensions/input_method_api.cc
|
| +++ b/chrome/browser/chromeos/extensions/input_method_api.cc
|
| @@ -4,11 +4,13 @@
|
|
|
| #include "chrome/browser/chromeos/extensions/input_method_api.h"
|
|
|
| +#include "base/command_line.h"
|
| #include "base/lazy_instance.h"
|
| #include "base/values.h"
|
| #include "chrome/browser/chromeos/extensions/input_method_event_router.h"
|
| #include "chrome/browser/chromeos/input_method/input_method_util.h"
|
| #include "chrome/browser/extensions/api/input_ime/input_ime_api.h"
|
| +#include "chromeos/chromeos_switches.h"
|
| #include "chromeos/ime/extension_ime_util.h"
|
| #include "chromeos/ime/input_method_descriptor.h"
|
| #include "chromeos/ime/input_method_manager.h"
|
| @@ -25,6 +27,19 @@ const char kXkbPrefix[] = "xkb:";
|
|
|
| namespace extensions {
|
|
|
| +ExtensionFunction::ResponseAction GetInputMethodConfigFunction::Run() {
|
| +#if !defined(OS_CHROMEOS)
|
| + EXTENSION_FUNCTION_VALIDATE(false);
|
| +#else
|
| + base::DictionaryValue* output = new base::DictionaryValue();
|
| + output->SetBoolean(
|
| + "isPhysicalKeyboardAutocorrectEnabled",
|
| + CommandLine::ForCurrentProcess()->HasSwitch(
|
| + chromeos::switches::kEnablePhysicalKeyboardAutocorrect));
|
| + return RespondNow(OneArgument(output));
|
| +#endif
|
| +}
|
| +
|
| ExtensionFunction::ResponseAction GetCurrentInputMethodFunction::Run() {
|
| #if !defined(OS_CHROMEOS)
|
| EXTENSION_FUNCTION_VALIDATE(false);
|
| @@ -91,6 +106,7 @@ InputMethodAPI::InputMethodAPI(content::BrowserContext* context)
|
| EventRouter::Get(context_)->RegisterObserver(this, kOnInputMethodChanged);
|
| ExtensionFunctionRegistry* registry =
|
| ExtensionFunctionRegistry::GetInstance();
|
| + registry->RegisterFunction<GetInputMethodConfigFunction>();
|
| registry->RegisterFunction<GetCurrentInputMethodFunction>();
|
| registry->RegisterFunction<SetCurrentInputMethodFunction>();
|
| registry->RegisterFunction<GetInputMethodsFunction>();
|
|
|