| 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 18 matching lines...) Expand all Loading... |
| 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 base::CommandLine::ForCurrentProcess()->HasSwitch( | 37 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 38 chromeos::switches::kEnablePhysicalKeyboardAutocorrect)); | 38 chromeos::switches::kEnablePhysicalKeyboardAutocorrect)); |
| 39 output->SetBoolean("isNewQPInputViewEnabled", | 39 output->SetBoolean("isNewMDInputViewEnabled", |
| 40 base::CommandLine::ForCurrentProcess()->HasSwitch( | 40 base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 41 chromeos::switches::kEnableNewQPInputView)); | 41 chromeos::switches::kEnableNewMDInputView)); |
| 42 return RespondNow(OneArgument(output)); | 42 return RespondNow(OneArgument(output)); |
| 43 #endif | 43 #endif |
| 44 } | 44 } |
| 45 | 45 |
| 46 ExtensionFunction::ResponseAction GetCurrentInputMethodFunction::Run() { | 46 ExtensionFunction::ResponseAction GetCurrentInputMethodFunction::Run() { |
| 47 #if !defined(OS_CHROMEOS) | 47 #if !defined(OS_CHROMEOS) |
| 48 EXTENSION_FUNCTION_VALIDATE(false); | 48 EXTENSION_FUNCTION_VALIDATE(false); |
| 49 #else | 49 #else |
| 50 chromeos::input_method::InputMethodManager* manager = | 50 chromeos::input_method::InputMethodManager* manager = |
| 51 chromeos::input_method::InputMethodManager::Get(); | 51 chromeos::input_method::InputMethodManager::Get(); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 static base::LazyInstance<BrowserContextKeyedAPIFactory<InputMethodAPI> > | 144 static base::LazyInstance<BrowserContextKeyedAPIFactory<InputMethodAPI> > |
| 145 g_factory = LAZY_INSTANCE_INITIALIZER; | 145 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 146 | 146 |
| 147 // static | 147 // static |
| 148 BrowserContextKeyedAPIFactory<InputMethodAPI>* | 148 BrowserContextKeyedAPIFactory<InputMethodAPI>* |
| 149 InputMethodAPI::GetFactoryInstance() { | 149 InputMethodAPI::GetFactoryInstance() { |
| 150 return g_factory.Pointer(); | 150 return g_factory.Pointer(); |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace extensions | 153 } // namespace extensions |
| OLD | NEW |