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 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_COMPONENT_EXTENSION_IME_MANAGER_IMP
L_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_COMPONENT_EXTENSION_IME_MANAGER_IMP
L_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_COMPONENT_EXTENSION_IME_MANAGER_IMP
L_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_COMPONENT_EXTENSION_IME_MANAGER_IMP
L_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 static void ReadComponentExtensionsInfo( | 47 static void ReadComponentExtensionsInfo( |
48 std::vector<ComponentExtensionIME>* out_imes); | 48 std::vector<ComponentExtensionIME>* out_imes); |
49 | 49 |
50 // This function is called on UI thread after ReadComponentExtensionsInfo | 50 // This function is called on UI thread after ReadComponentExtensionsInfo |
51 // function is finished. No need to release |result|. | 51 // function is finished. No need to release |result|. |
52 void OnReadComponentExtensionsInfo(std::vector<ComponentExtensionIME>* result, | 52 void OnReadComponentExtensionsInfo(std::vector<ComponentExtensionIME>* result, |
53 const base::Closure& callback); | 53 const base::Closure& callback); |
54 | 54 |
55 // Reads manifest.json file in |file_path|. This function must be called on | 55 // Reads manifest.json file in |file_path|. This function must be called on |
56 // file thread. | 56 // file thread. |
57 static scoped_ptr<DictionaryValue> GetManifest( | 57 static scoped_ptr<base::DictionaryValue> GetManifest( |
58 const base::FilePath& file_path); | 58 const base::FilePath& file_path); |
59 | 59 |
60 // Reads extension information: description, option page. This function | 60 // Reads extension information: description, option page. This function |
61 // returns true on success, otherwise returns false. This function must be | 61 // returns true on success, otherwise returns false. This function must be |
62 // called on file thread. | 62 // called on file thread. |
63 static bool ReadExtensionInfo(const DictionaryValue& manifest, | 63 static bool ReadExtensionInfo(const base::DictionaryValue& manifest, |
64 const std::string& extension_id, | 64 const std::string& extension_id, |
65 ComponentExtensionIME* out); | 65 ComponentExtensionIME* out); |
66 | 66 |
67 // Reads each engine component in |dict|. |dict| is given by GetList with | 67 // Reads each engine component in |dict|. |dict| is given by GetList with |
68 // kInputComponents key from manifest. This function returns true on success, | 68 // kInputComponents key from manifest. This function returns true on success, |
69 // otherwise retrun false. This function must be called on FILE thread. | 69 // otherwise retrun false. This function must be called on FILE thread. |
70 static bool ReadEngineComponent(const DictionaryValue& dict, | 70 static bool ReadEngineComponent(const base::DictionaryValue& dict, |
71 ComponentExtensionEngine* out); | 71 ComponentExtensionEngine* out); |
72 | 72 |
73 // True if initialized. | 73 // True if initialized. |
74 bool is_initialized_; | 74 bool is_initialized_; |
75 | 75 |
76 // The list of component extension IME. | 76 // The list of component extension IME. |
77 std::vector<ComponentExtensionIME> component_extension_list_; | 77 std::vector<ComponentExtensionIME> component_extension_list_; |
78 | 78 |
79 // The list of already loaded extension ids. | 79 // The list of already loaded extension ids. |
80 std::set<std::string> loaded_extension_id_; | 80 std::set<std::string> loaded_extension_id_; |
81 | 81 |
82 // For checking the function should be called on UI thread. | 82 // For checking the function should be called on UI thread. |
83 base::ThreadChecker thread_checker_; | 83 base::ThreadChecker thread_checker_; |
84 base::WeakPtrFactory<ComponentExtensionIMEManagerImpl> weak_ptr_factory_; | 84 base::WeakPtrFactory<ComponentExtensionIMEManagerImpl> weak_ptr_factory_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(ComponentExtensionIMEManagerImpl); | 86 DISALLOW_COPY_AND_ASSIGN(ComponentExtensionIMEManagerImpl); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace chromeos | 89 } // namespace chromeos |
90 | 90 |
91 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_COMPONENT_EXTENSION_IME_MANAGER_
IMPL_H_ | 91 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_COMPONENT_EXTENSION_IME_MANAGER_
IMPL_H_ |
92 | 92 |
OLD | NEW |