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_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/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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 ExtensionInputImeEventRouter::GetInstance() { | 319 ExtensionInputImeEventRouter::GetInstance() { |
320 return Singleton<ExtensionInputImeEventRouter>::get(); | 320 return Singleton<ExtensionInputImeEventRouter>::get(); |
321 } | 321 } |
322 | 322 |
323 void ExtensionInputImeEventRouter::Init() {} | 323 void ExtensionInputImeEventRouter::Init() {} |
324 | 324 |
325 #if defined(OS_CHROMEOS) | 325 #if defined(OS_CHROMEOS) |
326 bool ExtensionInputImeEventRouter::RegisterIme( | 326 bool ExtensionInputImeEventRouter::RegisterIme( |
327 Profile* profile, | 327 Profile* profile, |
328 const std::string& extension_id, | 328 const std::string& extension_id, |
329 const Extension::InputComponentInfo& component) { | 329 const extensions::Extension::InputComponentInfo& component) { |
330 VLOG(1) << "RegisterIme: " << extension_id << " id: " << component.id; | 330 VLOG(1) << "RegisterIme: " << extension_id << " id: " << component.id; |
331 | 331 |
332 std::map<std::string, chromeos::InputMethodEngine*>& engine_map = | 332 std::map<std::string, chromeos::InputMethodEngine*>& engine_map = |
333 engines_[extension_id]; | 333 engines_[extension_id]; |
334 | 334 |
335 std::map<std::string, chromeos::InputMethodEngine*>::iterator engine_ix = | 335 std::map<std::string, chromeos::InputMethodEngine*>::iterator engine_ix = |
336 engine_map.find(component.id); | 336 engine_map.find(component.id); |
337 if (engine_ix != engine_map.end()) { | 337 if (engine_ix != engine_map.end()) { |
338 return false; | 338 return false; |
339 } | 339 } |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 | 823 |
824 bool handled = false; | 824 bool handled = false; |
825 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(1, &handled)); | 825 EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(1, &handled)); |
826 | 826 |
827 ExtensionInputImeEventRouter::GetInstance()->OnEventHandled( | 827 ExtensionInputImeEventRouter::GetInstance()->OnEventHandled( |
828 extension_id(), request_id_str, handled); | 828 extension_id(), request_id_str, handled); |
829 | 829 |
830 return true; | 830 return true; |
831 } | 831 } |
832 #endif | 832 #endif |
OLD | NEW |