OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/chromeos/input_method/component_extension_ime_manager_i
mpl.h" | 5 #include "chrome/browser/chromeos/input_method/component_extension_ime_manager_i
mpl.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "chrome/browser/extensions/component_loader.h" | 10 #include "chrome/browser/extensions/component_loader.h" |
11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
12 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
13 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
14 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
15 #include "chrome/common/extensions/extension_constants.h" | 15 #include "chrome/common/extensions/extension_constants.h" |
16 #include "chrome/common/extensions/extension_file_util.h" | 16 #include "chrome/common/extensions/extension_file_util.h" |
| 17 #include "chromeos/ime/extension_ime_util.h" |
17 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
18 #include "extensions/browser/extension_system.h" | 19 #include "extensions/browser/extension_system.h" |
19 #include "extensions/common/extension.h" | 20 #include "extensions/common/extension.h" |
20 #include "extensions/common/extension_l10n_util.h" | 21 #include "extensions/common/extension_l10n_util.h" |
21 #include "extensions/common/file_util.h" | 22 #include "extensions/common/file_util.h" |
22 #include "extensions/common/manifest_constants.h" | 23 #include "extensions/common/manifest_constants.h" |
23 #include "ui/base/l10n/l10n_util.h" | 24 #include "ui/base/l10n/l10n_util.h" |
24 | 25 |
25 namespace chromeos { | 26 namespace chromeos { |
26 | 27 |
27 namespace { | 28 namespace { |
28 | 29 |
29 struct WhitelistedComponentExtensionIME { | 30 struct WhitelistedComponentExtensionIME { |
30 const char* id; | 31 const char* id; |
31 const char* path; | 32 const char* path; |
32 } whitelisted_component_extension[] = { | 33 } whitelisted_component_extension[] = { |
33 { | 34 { |
34 // ChromeOS Hangul Input. | 35 // ChromeOS Hangul Input. |
35 "bdgdidmhaijohebebipajioienkglgfo", | 36 extension_ime_util::kHangulExtensionId, |
36 "/usr/share/chromeos-assets/input_methods/hangul", | 37 "/usr/share/chromeos-assets/input_methods/hangul", |
37 }, | 38 }, |
| 39 { |
| 40 // Official Google Japanese Input. |
| 41 extension_ime_util::kMozcExtensionId, |
| 42 "/usr/share/chromeos-assets/input_methods/nacl_mozc", |
| 43 }, |
38 #if defined(OFFICIAL_BUILD) | 44 #if defined(OFFICIAL_BUILD) |
39 { | 45 { |
40 // Official Google XKB Input. | 46 // Official Google XKB Input. |
41 "jkghodnilhceideoidjikpgommlajknk", | 47 extension_ime_util::kXkbExtensionId, |
42 "/usr/share/chromeos-assets/input_methods/google_xkb", | 48 "/usr/share/chromeos-assets/input_methods/google_xkb", |
43 }, | 49 }, |
44 { | 50 { |
45 // Official Google Keyboards Input. | 51 // Official Google Keyboards Input. |
46 "habcdindjejkmepknlhkkloncjcpcnbf", | 52 extension_ime_util::kM17nExtensionId, |
47 "/usr/share/chromeos-assets/input_methods/google_keyboards", | 53 "/usr/share/chromeos-assets/input_methods/google_keyboards", |
48 }, | 54 }, |
49 { | 55 { |
50 // Google input tools. | 56 // Google input tools. |
51 "gjaehgfemfahhmlgpdfknkhdnemmolop", | 57 extension_ime_util::kT13nExtensionId, |
52 "/usr/share/chromeos-assets/input_methods/input_tools", | 58 "/usr/share/chromeos-assets/input_methods/input_tools", |
53 }, | 59 }, |
54 #else | 60 #else |
55 { | 61 { |
56 // Open-sourced ChromeOS xkb extension. | 62 // Open-sourced ChromeOS xkb extension. |
57 "fgoepimhcoialccpbmpnnblemnepkkao", | 63 extension_ime_util::kXkbExtensionId, |
58 "/usr/share/chromeos-assets/input_methods/xkb", | 64 "/usr/share/chromeos-assets/input_methods/xkb", |
59 }, | 65 }, |
60 { | 66 { |
61 // Open-sourced ChromeOS Keyboards extension. | 67 // Open-sourced ChromeOS Keyboards extension. |
62 "jhffeifommiaekmbkkjlpmilogcfdohp", | 68 extension_ime_util::kM17nExtensionId, |
63 "/usr/share/chromeos-assets/input_methods/keyboard_layouts", | 69 "/usr/share/chromeos-assets/input_methods/keyboard_layouts", |
64 }, | 70 }, |
65 { | 71 { |
66 // Open-sourced Pinyin Chinese Input Method. | 72 // Open-sourced Pinyin Chinese Input Method. |
67 "cpgalbafkoofkjmaeonnfijgpfennjjn", | 73 extension_ime_util::kChinesePinyinExtensionId, |
68 "/usr/share/chromeos-assets/input_methods/pinyin", | 74 "/usr/share/chromeos-assets/input_methods/pinyin", |
69 }, | 75 }, |
70 { | 76 { |
71 // Open-sourced Zhuyin Chinese Input Method. | 77 // Open-sourced Zhuyin Chinese Input Method. |
72 "ekbifjdfhkmdeeajnolmgdlmkllopefi", | 78 extension_ime_util::kChineseZhuyinExtensionId, |
73 "/usr/share/chromeos-assets/input_methods/zhuyin", | 79 "/usr/share/chromeos-assets/input_methods/zhuyin", |
74 }, | 80 }, |
75 { | 81 { |
76 // Open-sourced Cangjie Chinese Input Method. | 82 // Open-sourced Cangjie Chinese Input Method. |
77 "aeebooiibjahgpgmhkeocbeekccfknbj", | 83 extension_ime_util::kChineseCangjieExtensionId, |
78 "/usr/share/chromeos-assets/input_methods/cangjie", | 84 "/usr/share/chromeos-assets/input_methods/cangjie", |
79 }, | 85 }, |
80 { | |
81 // Open-sourced Mozc Japanese Input. | |
82 "bbaiamgfapehflhememkfglaehiobjnk", | |
83 "/usr/share/chromeos-assets/input_methods/nacl_mozc", | |
84 }, | |
85 #endif | 86 #endif |
86 { | 87 { |
87 // Braille hardware keyboard IME that works together with ChromeVox. | 88 // Braille hardware keyboard IME that works together with ChromeVox. |
88 extension_misc::kBrailleImeExtensionId, | 89 extension_misc::kBrailleImeExtensionId, |
89 extension_misc::kBrailleImeExtensionPath, | 90 extension_misc::kBrailleImeExtensionPath, |
90 }, | 91 }, |
91 }; | 92 }; |
92 | 93 |
93 extensions::ComponentLoader* GetComponentLoader() { | 94 extensions::ComponentLoader* GetComponentLoader() { |
94 // TODO(skuhne, nkostylev): At this time the only thing which makes sense here | 95 // TODO(skuhne, nkostylev): At this time the only thing which makes sense here |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 std::vector<ComponentExtensionIME>* result, | 338 std::vector<ComponentExtensionIME>* result, |
338 const base::Closure& callback) { | 339 const base::Closure& callback) { |
339 DCHECK(thread_checker_.CalledOnValidThread()); | 340 DCHECK(thread_checker_.CalledOnValidThread()); |
340 DCHECK(result); | 341 DCHECK(result); |
341 component_extension_list_ = *result; | 342 component_extension_list_ = *result; |
342 is_initialized_ = true; | 343 is_initialized_ = true; |
343 callback.Run(); | 344 callback.Run(); |
344 } | 345 } |
345 | 346 |
346 } // namespace chromeos | 347 } // namespace chromeos |
OLD | NEW |