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 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "base/sequenced_task_runner.h" | 13 #include "base/sequenced_task_runner.h" |
14 #include "base/threading/thread_checker.h" | 14 #include "base/threading/thread_checker.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chromeos/ime/component_extension_ime_manager.h" | 16 #include "chromeos/ime/component_extension_ime_manager.h" |
17 | 17 |
| 18 class Profile; |
| 19 |
18 namespace chromeos { | 20 namespace chromeos { |
19 | 21 |
20 // The implementation class of ComponentExtensionIMEManagerDelegate. | 22 // The implementation class of ComponentExtensionIMEManagerDelegate. |
21 class ComponentExtensionIMEManagerImpl | 23 class ComponentExtensionIMEManagerImpl |
22 : public ComponentExtensionIMEManagerDelegate { | 24 : public ComponentExtensionIMEManagerDelegate { |
23 public: | 25 public: |
24 ComponentExtensionIMEManagerImpl(); | 26 ComponentExtensionIMEManagerImpl(); |
25 virtual ~ComponentExtensionIMEManagerImpl(); | 27 virtual ~ComponentExtensionIMEManagerImpl(); |
26 | 28 |
27 // ComponentExtensionIMEManagerDelegate overrides: | 29 // ComponentExtensionIMEManagerDelegate overrides: |
28 virtual std::vector<ComponentExtensionIME> ListIME() OVERRIDE; | 30 virtual std::vector<ComponentExtensionIME> ListIME() OVERRIDE; |
29 virtual bool Load(const std::string& extension_id, | 31 virtual bool Load(Profile* profile, |
| 32 const std::string& extension_id, |
30 const std::string& manifest, | 33 const std::string& manifest, |
31 const base::FilePath& file_path) OVERRIDE; | 34 const base::FilePath& file_path) OVERRIDE; |
32 virtual void Unload(const std::string& extension_id, | 35 virtual void Unload(Profile* profile, |
| 36 const std::string& extension_id, |
33 const base::FilePath& file_path) OVERRIDE; | 37 const base::FilePath& file_path) OVERRIDE; |
34 | 38 |
35 private: | 39 private: |
36 // Reads component extensions and extract their localized information: name, | 40 // Reads component extensions and extract their localized information: name, |
37 // description and ime id. This function fills them into |out_imes|. | 41 // description and ime id. This function fills them into |out_imes|. |
38 static void ReadComponentExtensionsInfo( | 42 static void ReadComponentExtensionsInfo( |
39 std::vector<ComponentExtensionIME>* out_imes); | 43 std::vector<ComponentExtensionIME>* out_imes); |
40 | 44 |
41 // Parses manifest string to manifest json dictionary value. | 45 // Parses manifest string to manifest json dictionary value. |
42 static scoped_ptr<base::DictionaryValue> GetManifest( | 46 static scoped_ptr<base::DictionaryValue> GetManifest( |
(...skipping 20 matching lines...) Expand all Loading... |
63 base::ThreadChecker thread_checker_; | 67 base::ThreadChecker thread_checker_; |
64 base::WeakPtrFactory<ComponentExtensionIMEManagerImpl> weak_ptr_factory_; | 68 base::WeakPtrFactory<ComponentExtensionIMEManagerImpl> weak_ptr_factory_; |
65 | 69 |
66 DISALLOW_COPY_AND_ASSIGN(ComponentExtensionIMEManagerImpl); | 70 DISALLOW_COPY_AND_ASSIGN(ComponentExtensionIMEManagerImpl); |
67 }; | 71 }; |
68 | 72 |
69 } // namespace chromeos | 73 } // namespace chromeos |
70 | 74 |
71 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_COMPONENT_EXTENSION_IME_MANAGER_
IMPL_H_ | 75 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_COMPONENT_EXTENSION_IME_MANAGER_
IMPL_H_ |
72 | 76 |
OLD | NEW |