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 // Defines the Chrome Extensions Cookies API functions for accessing internet | 5 // Defines the Chrome Extensions Cookies API functions for accessing internet |
6 // cookies, as specified in the extension API JSON. | 6 // cookies, as specified in the extension API JSON. |
7 | 7 |
8 #ifndef CHROME_BROWSER_EXTENSIONS_API_COOKIES_COOKIES_API_H_ | 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_COOKIES_COOKIES_API_H_ |
9 #define CHROME_BROWSER_EXTENSIONS_API_COOKIES_COOKIES_API_H_ | 9 #define CHROME_BROWSER_EXTENSIONS_API_COOKIES_COOKIES_API_H_ |
10 | 10 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 | 194 |
195 class CookiesAPI : public ProfileKeyedAPI, | 195 class CookiesAPI : public ProfileKeyedAPI, |
196 public extensions::EventRouter::Observer { | 196 public extensions::EventRouter::Observer { |
197 public: | 197 public: |
198 explicit CookiesAPI(Profile* profile); | 198 explicit CookiesAPI(Profile* profile); |
199 virtual ~CookiesAPI(); | 199 virtual ~CookiesAPI(); |
200 | 200 |
201 // ProfileKeyedService implementation. | 201 // ProfileKeyedService implementation. |
202 virtual void Shutdown() OVERRIDE; | 202 virtual void Shutdown() OVERRIDE; |
203 | 203 |
| 204 // ProfileKeyedAPI implementation. |
| 205 static ProfileKeyedAPIFactory<CookiesAPI>* GetFactoryInstance(); |
| 206 |
204 // EventRouter::Observer implementation. | 207 // EventRouter::Observer implementation. |
205 virtual void OnListenerAdded(const extensions::EventListenerInfo& details) | 208 virtual void OnListenerAdded(const extensions::EventListenerInfo& details) |
206 OVERRIDE; | 209 OVERRIDE; |
207 | 210 |
208 private: | 211 private: |
209 friend class ProfileKeyedAPIFactory<CookiesAPI>; | 212 friend class ProfileKeyedAPIFactory<CookiesAPI>; |
210 | 213 |
211 Profile* profile_; | 214 Profile* profile_; |
212 | 215 |
213 // ProfileKeyedAPI implementation. | 216 // ProfileKeyedAPI implementation. |
214 static const char* service_name() { | 217 static const char* service_name() { |
215 return "CookiesAPI"; | 218 return "CookiesAPI"; |
216 } | 219 } |
217 static const bool kServiceIsNULLWhileTesting = true; | 220 static const bool kServiceIsNULLWhileTesting = true; |
218 | 221 |
219 // Created lazily upon OnListenerAdded. | 222 // Created lazily upon OnListenerAdded. |
220 scoped_ptr<CookiesEventRouter> cookies_event_router_; | 223 scoped_ptr<CookiesEventRouter> cookies_event_router_; |
221 | 224 |
222 DISALLOW_COPY_AND_ASSIGN(CookiesAPI); | 225 DISALLOW_COPY_AND_ASSIGN(CookiesAPI); |
223 }; | 226 }; |
224 | 227 |
225 template <> | |
226 ProfileKeyedAPIFactory<CookiesAPI>* | |
227 ProfileKeyedAPIFactory<CookiesAPI>::GetInstance(); | |
228 | |
229 } // namespace extensions | 228 } // namespace extensions |
230 | 229 |
231 #endif // CHROME_BROWSER_EXTENSIONS_API_COOKIES_COOKIES_API_H_ | 230 #endif // CHROME_BROWSER_EXTENSIONS_API_COOKIES_COOKIES_API_H_ |
OLD | NEW |