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

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc

Issue 1771173002: Implement input.ime.sendKeyEvents API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failure. Created 4 years, 9 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/extensions/api/input_ime/input_ime_api_chromeos.cc
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc b/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc
index eabbb1dcf598a1b63fa961eabc93408a479d6935..e2fdc7dc16b58311b7f14d275d0960613630026a 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.cc
@@ -28,7 +28,6 @@ namespace input_ime = extensions::api::input_ime;
namespace DeleteSurroundingText =
extensions::api::input_ime::DeleteSurroundingText;
namespace UpdateMenuItems = extensions::api::input_ime::UpdateMenuItems;
-namespace SendKeyEvents = extensions::api::input_ime::SendKeyEvents;
namespace HideInputView = extensions::api::input_ime::HideInputView;
namespace SetMenuItems = extensions::api::input_ime::SetMenuItems;
namespace SetCursorPosition = extensions::api::input_ime::SetCursorPosition;
@@ -378,43 +377,6 @@ bool InputImeHideInputViewFunction::RunAsync() {
return true;
}
-bool InputImeSendKeyEventsFunction::RunAsync() {
- scoped_ptr<SendKeyEvents::Params> parent_params(
- SendKeyEvents::Params::Create(*args_));
- const SendKeyEvents::Params::Parameters& params =
- parent_params->parameters;
- InputMethodEngine* engine = GetActiveEngine(
- Profile::FromBrowserContext(browser_context()), extension_id());
- if (!engine) {
- error_ = kErrorEngineNotAvailable;
- return false;
- }
-
- const std::vector<linked_ptr<input_ime::KeyboardEvent> >& key_data =
- params.key_data;
- std::vector<InputMethodEngineBase::KeyboardEvent> key_data_out;
-
- for (size_t i = 0; i < key_data.size(); ++i) {
- InputMethodEngineBase::KeyboardEvent event;
- event.type = input_ime::ToString(key_data[i]->type);
- event.key = key_data[i]->key;
- event.code = key_data[i]->code;
- event.key_code = key_data[i]->key_code.get() ? *(key_data[i]->key_code) : 0;
- if (key_data[i]->alt_key)
- event.alt_key = *(key_data[i]->alt_key);
- if (key_data[i]->ctrl_key)
- event.ctrl_key = *(key_data[i]->ctrl_key);
- if (key_data[i]->shift_key)
- event.shift_key = *(key_data[i]->shift_key);
- if (key_data[i]->caps_lock)
- event.caps_lock = *(key_data[i]->caps_lock);
- key_data_out.push_back(event);
- }
-
- engine->SendKeyEvents(params.context_id, key_data_out);
- return true;
-}
-
bool InputImeSetCandidateWindowPropertiesFunction::RunSync() {
scoped_ptr<SetCandidateWindowProperties::Params> parent_params(
SetCandidateWindowProperties::Params::Create(*args_));
« no previous file with comments | « chrome/browser/extensions/api/input_ime/input_ime_api_chromeos.h ('k') | chrome/browser/ui/input_method/input_method_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698