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 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 // ExtensionFunction: | 172 // ExtensionFunction: |
173 virtual bool RunImpl() OVERRIDE; | 173 virtual bool RunImpl() OVERRIDE; |
174 }; | 174 }; |
175 | 175 |
176 class InputImeAPI : public ProfileKeyedAPI, | 176 class InputImeAPI : public ProfileKeyedAPI, |
177 public content::NotificationObserver { | 177 public content::NotificationObserver { |
178 public: | 178 public: |
179 explicit InputImeAPI(Profile* profile); | 179 explicit InputImeAPI(Profile* profile); |
180 virtual ~InputImeAPI(); | 180 virtual ~InputImeAPI(); |
181 | 181 |
| 182 // ProfileKeyedAPI implementation. |
| 183 static ProfileKeyedAPIFactory<InputImeAPI>* GetFactoryInstance(); |
| 184 |
182 // content::NotificationObserver implementation. | 185 // content::NotificationObserver implementation. |
183 virtual void Observe(int type, | 186 virtual void Observe(int type, |
184 const content::NotificationSource& source, | 187 const content::NotificationSource& source, |
185 const content::NotificationDetails& details) OVERRIDE; | 188 const content::NotificationDetails& details) OVERRIDE; |
186 | 189 |
187 private: | 190 private: |
188 friend class ProfileKeyedAPIFactory<InputImeAPI>; | 191 friend class ProfileKeyedAPIFactory<InputImeAPI>; |
189 InputImeEventRouter* input_ime_event_router(); | 192 InputImeEventRouter* input_ime_event_router(); |
190 | 193 |
191 // ProfileKeyedAPI implementation. | 194 // ProfileKeyedAPI implementation. |
192 static const char* service_name() { | 195 static const char* service_name() { |
193 return "InputImeAPI"; | 196 return "InputImeAPI"; |
194 } | 197 } |
195 static const bool kServiceIsNULLWhileTesting = true; | 198 static const bool kServiceIsNULLWhileTesting = true; |
196 | 199 |
197 Profile* const profile_; | 200 Profile* const profile_; |
198 content::NotificationRegistrar registrar_; | 201 content::NotificationRegistrar registrar_; |
199 }; | 202 }; |
200 | 203 |
201 template <> | |
202 ProfileKeyedAPIFactory<InputImeAPI>* | |
203 ProfileKeyedAPIFactory<InputImeAPI>::GetInstance(); | |
204 | |
205 } // namespace extensions | 204 } // namespace extensions |
206 | 205 |
207 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ | 206 #endif // CHROME_BROWSER_EXTENSIONS_API_INPUT_IME_INPUT_IME_API_H_ |
OLD | NEW |