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/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/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/chromeos/input_method/input_method_engine.h" | 12 #include "chrome/browser/chromeos/input_method/input_method_engine.h" |
13 #include "chrome/browser/extensions/event_router.h" | 13 #include "chrome/browser/extensions/event_router.h" |
14 #include "chrome/browser/extensions/extension_function_registry.h" | 14 #include "chrome/browser/extensions/extension_function_registry.h" |
15 #include "chrome/browser/extensions/extension_input_module_constants.h" | 15 #include "chrome/browser/extensions/extension_input_module_constants.h" |
16 #include "chrome/browser/extensions/extension_system.h" | 16 #include "chrome/browser/extensions/extension_system.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/common/extensions/extension_manifest_constants.h" | |
19 | 18 |
20 namespace keys = extension_input_module_constants; | 19 namespace keys = extension_input_module_constants; |
21 | 20 |
22 namespace { | 21 namespace { |
23 | 22 |
24 const char kStyleNone[] = "none"; | 23 const char kStyleNone[] = "none"; |
25 const char kStyleCheck[] = "check"; | 24 const char kStyleCheck[] = "check"; |
26 const char kStyleRadio[] = "radio"; | 25 const char kStyleRadio[] = "radio"; |
27 const char kStyleSeparator[] = "separator"; | 26 const char kStyleSeparator[] = "separator"; |
28 | 27 |
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 | 853 |
855 InputImeEventRouter::GetInstance()->OnKeyEventHandled( | 854 InputImeEventRouter::GetInstance()->OnKeyEventHandled( |
856 extension_id(), request_id_str, handled); | 855 extension_id(), request_id_str, handled); |
857 | 856 |
858 return true; | 857 return true; |
859 } | 858 } |
860 #endif | 859 #endif |
861 | 860 |
862 InputImeAPI::InputImeAPI(Profile* profile) | 861 InputImeAPI::InputImeAPI(Profile* profile) |
863 : profile_(profile) { | 862 : profile_(profile) { |
864 ManifestHandler::Register(extension_manifest_keys::kInputComponents, | 863 (new InputComponentsHandler)->Register(); |
865 make_linked_ptr(new InputComponentsHandler)); | |
866 | 864 |
867 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, | 865 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED, |
868 content::Source<Profile>(profile)); | 866 content::Source<Profile>(profile)); |
869 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, | 867 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, |
870 content::Source<Profile>(profile)); | 868 content::Source<Profile>(profile)); |
871 | 869 |
872 ExtensionFunctionRegistry* registry = | 870 ExtensionFunctionRegistry* registry = |
873 ExtensionFunctionRegistry::GetInstance(); | 871 ExtensionFunctionRegistry::GetInstance(); |
874 registry->RegisterFunction<SetCompositionFunction>(); | 872 registry->RegisterFunction<SetCompositionFunction>(); |
875 registry->RegisterFunction<ClearCompositionFunction>(); | 873 registry->RegisterFunction<ClearCompositionFunction>(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 input_ime_event_router()->UnregisterAllImes(profile_, extension->id()); | 920 input_ime_event_router()->UnregisterAllImes(profile_, extension->id()); |
923 } | 921 } |
924 } | 922 } |
925 } | 923 } |
926 | 924 |
927 InputImeEventRouter* InputImeAPI::input_ime_event_router() { | 925 InputImeEventRouter* InputImeAPI::input_ime_event_router() { |
928 return InputImeEventRouter::GetInstance(); | 926 return InputImeEventRouter::GetInstance(); |
929 } | 927 } |
930 | 928 |
931 } // namespace extensions | 929 } // namespace extensions |
OLD | NEW |