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

Side by Side Diff: chrome/browser/extensions/api/input_ime/input_ime_api.cc

Issue 11299270: Add a parameter that specifies whether onKeyEvent is asynchronous (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Code review fix Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/api/input_ime/input_ime_api.h" 5 #include "chrome/browser/extensions/api/input_ime/input_ime_api.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 engine_ix != engine_list->second.end(); 409 engine_ix != engine_list->second.end();
410 ++engine_ix) { 410 ++engine_ix) {
411 if (engine_ix->second->IsActive()) { 411 if (engine_ix->second->IsActive()) {
412 return engine_ix->second; 412 return engine_ix->second;
413 } 413 }
414 } 414 }
415 } 415 }
416 return NULL; 416 return NULL;
417 } 417 }
418 418
419 void InputImeEventRouter::OnEventHandled( 419 void InputImeEventRouter::OnKeyEventHandled(
420 const std::string& extension_id, 420 const std::string& extension_id,
421 const std::string& request_id, 421 const std::string& request_id,
422 bool handled) { 422 bool handled) {
423 RequestMap::iterator request = request_map_.find(request_id); 423 RequestMap::iterator request = request_map_.find(request_id);
424 if (request == request_map_.end()) { 424 if (request == request_map_.end()) {
425 LOG(ERROR) << "Request ID not found: " << request_id; 425 LOG(ERROR) << "Request ID not found: " << request_id;
426 return; 426 return;
427 } 427 }
428 428
429 std::string engine_id = request->second.first; 429 std::string engine_id = request->second.first;
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 813
814 std::vector<chromeos::InputMethodEngine::MenuItem> menu_items; 814 std::vector<chromeos::InputMethodEngine::MenuItem> menu_items;
815 EXTENSION_FUNCTION_VALIDATE(ReadMenuItems(items, &menu_items)); 815 EXTENSION_FUNCTION_VALIDATE(ReadMenuItems(items, &menu_items));
816 816
817 if (!engine->UpdateMenuItems(menu_items)) { 817 if (!engine->UpdateMenuItems(menu_items)) {
818 error_ = kErrorUpdateMenuItemsFail; 818 error_ = kErrorUpdateMenuItemsFail;
819 } 819 }
820 return true; 820 return true;
821 } 821 }
822 822
823 bool InputEventHandled::RunImpl() { 823 bool KeyEventHandled::RunImpl() {
824 std::string request_id_str; 824 std::string request_id_str;
825 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &request_id_str)); 825 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &request_id_str));
826 826
827 bool handled = false; 827 bool handled = false;
828 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(1, &handled)); 828 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(1, &handled));
829 829
830 InputImeEventRouter::GetInstance()->OnEventHandled( 830 InputImeEventRouter::GetInstance()->OnKeyEventHandled(
831 extension_id(), request_id_str, handled); 831 extension_id(), request_id_str, handled);
832 832
833 return true; 833 return true;
834 } 834 }
835 #endif 835 #endif
836 836
837 } // namespace extensions 837 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/input_ime/input_ime_api.h ('k') | chrome/browser/extensions/extension_function_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698