OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_ime_api.h" | 5 #include "chrome/browser/extensions/extension_input_ime_api.h" |
6 | 6 |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/chromeos/input_method/input_method_engine.h" | 10 #include "chrome/browser/chromeos/input_method/input_method_engine.h" |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 result_.reset(Value::CreateBooleanValue(false)); | 772 result_.reset(Value::CreateBooleanValue(false)); |
773 return true; | 773 return true; |
774 } | 774 } |
775 | 775 |
776 DictionaryValue* args; | 776 DictionaryValue* args; |
777 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args)); | 777 EXTENSION_FUNCTION_VALIDATE(args_->GetDictionary(0, &args)); |
778 int context_id; | 778 int context_id; |
779 int candidate_id; | 779 int candidate_id; |
780 | 780 |
781 EXTENSION_FUNCTION_VALIDATE(args->GetInteger(keys::kContextIdKey, | 781 EXTENSION_FUNCTION_VALIDATE(args->GetInteger(keys::kContextIdKey, |
782 &context_id)); | 782 &context_id)); |
783 EXTENSION_FUNCTION_VALIDATE(args->GetInteger(keys::kCandidateIdKey, | 783 EXTENSION_FUNCTION_VALIDATE(args->GetInteger(keys::kCandidateIdKey, |
784 &candidate_id)); | 784 &candidate_id)); |
785 | 785 |
786 if (engine->SetCursorPosition(context_id, candidate_id, &error_)) { | 786 if (engine->SetCursorPosition(context_id, candidate_id, &error_)) { |
787 result_.reset(Value::CreateBooleanValue(true)); | 787 result_.reset(Value::CreateBooleanValue(true)); |
788 } else { | 788 } else { |
789 result_.reset(Value::CreateBooleanValue(false)); | 789 result_.reset(Value::CreateBooleanValue(false)); |
790 } | 790 } |
791 return true; | 791 return true; |
792 } | 792 } |
793 | 793 |
794 bool SetMenuItemsFunction::RunImpl() { | 794 bool SetMenuItemsFunction::RunImpl() { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
851 | 851 |
852 bool handled = false; | 852 bool handled = false; |
853 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(1, &handled)); | 853 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(1, &handled)); |
854 | 854 |
855 ExtensionInputImeEventRouter::GetInstance()->OnEventHandled( | 855 ExtensionInputImeEventRouter::GetInstance()->OnEventHandled( |
856 extension_id(), request_id_str, handled); | 856 extension_id(), request_id_str, handled); |
857 | 857 |
858 return true; | 858 return true; |
859 } | 859 } |
860 #endif | 860 #endif |
OLD | NEW |