Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Unified Diff: chrome/browser/chromeos/extensions/input_method_api.cc

Issue 676593004: Adds experimental flag --enable-experimental-ime-features. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>();

Powered by Google App Engine
This is Rietveld 408576698