| 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/extensions/extension_input_method_api.h" | 5 #include "chrome/browser/extensions/extension_input_method_api.h" |
| 6 | 6 |
| 7 #include "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 8 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 9 #include "chrome/browser/chromeos/extensions/input_method_event_router.h" | 9 #include "chrome/browser/chromeos/extensions/input_method_event_router.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 | 12 |
| 13 GetInputMethodFunction::GetInputMethodFunction() { | 13 GetInputMethodFunction::GetInputMethodFunction() { |
| 14 } | 14 } |
| 15 | 15 |
| 16 GetInputMethodFunction::~GetInputMethodFunction() { | 16 GetInputMethodFunction::~GetInputMethodFunction() { |
| 17 } | 17 } |
| 18 | 18 |
| 19 bool GetInputMethodFunction::RunImpl() { | 19 bool GetInputMethodFunction::RunImpl() { |
| 20 #if !defined(OS_CHROMEOS) | 20 #if !defined(OS_CHROMEOS) |
| 21 NOTREACHED(); | 21 NOTREACHED(); |
| 22 return false; | 22 return false; |
| 23 #else | 23 #else |
| 24 chromeos::ExtensionInputMethodEventRouter* router = | 24 chromeos::ExtensionInputMethodEventRouter* router = |
| 25 profile_->GetExtensionService()->input_method_event_router(); | 25 profile_->GetExtensionService()->input_method_event_router(); |
| 26 chromeos::input_method::InputMethodManager* manager = | 26 chromeos::input_method::InputMethodManager* manager = |
| 27 chromeos::input_method::InputMethodManager::GetInstance(); | 27 chromeos::input_method::InputMethodManager::GetInstance(); |
| 28 const std::string input_method = | 28 const std::string input_method = |
| 29 router->GetInputMethodForXkb(manager->GetCurrentInputMethod().id()); | 29 router->GetInputMethodForXkb(manager->GetCurrentInputMethod().id()); |
| 30 result_.reset(Value::CreateStringValue(input_method)); | 30 SetResult(Value::CreateStringValue(input_method)); |
| 31 return true; | 31 return true; |
| 32 #endif | 32 #endif |
| 33 } | 33 } |
| OLD | NEW |