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