| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 virtual void Run() OVERRIDE; | 192 virtual void Run() OVERRIDE; |
| 193 virtual bool RunImpl() OVERRIDE; | 193 virtual bool RunImpl() OVERRIDE; |
| 194 }; | 194 }; |
| 195 | 195 |
| 196 class CookiesAPI : public ProfileKeyedAPI, | 196 class CookiesAPI : public ProfileKeyedAPI, |
| 197 public extensions::EventRouter::Observer { | 197 public extensions::EventRouter::Observer { |
| 198 public: | 198 public: |
| 199 explicit CookiesAPI(Profile* profile); | 199 explicit CookiesAPI(Profile* profile); |
| 200 virtual ~CookiesAPI(); | 200 virtual ~CookiesAPI(); |
| 201 | 201 |
| 202 // ProfileKeyedService implementation. | 202 // BrowserContextKeyedService implementation. |
| 203 virtual void Shutdown() OVERRIDE; | 203 virtual void Shutdown() OVERRIDE; |
| 204 | 204 |
| 205 // ProfileKeyedAPI implementation. | 205 // ProfileKeyedAPI implementation. |
| 206 static ProfileKeyedAPIFactory<CookiesAPI>* GetFactoryInstance(); | 206 static ProfileKeyedAPIFactory<CookiesAPI>* GetFactoryInstance(); |
| 207 | 207 |
| 208 // EventRouter::Observer implementation. | 208 // EventRouter::Observer implementation. |
| 209 virtual void OnListenerAdded(const extensions::EventListenerInfo& details) | 209 virtual void OnListenerAdded(const extensions::EventListenerInfo& details) |
| 210 OVERRIDE; | 210 OVERRIDE; |
| 211 | 211 |
| 212 private: | 212 private: |
| 213 friend class ProfileKeyedAPIFactory<CookiesAPI>; | 213 friend class ProfileKeyedAPIFactory<CookiesAPI>; |
| 214 | 214 |
| 215 Profile* profile_; | 215 Profile* profile_; |
| 216 | 216 |
| 217 // ProfileKeyedAPI implementation. | 217 // ProfileKeyedAPI implementation. |
| 218 static const char* service_name() { | 218 static const char* service_name() { |
| 219 return "CookiesAPI"; | 219 return "CookiesAPI"; |
| 220 } | 220 } |
| 221 static const bool kServiceIsNULLWhileTesting = true; | 221 static const bool kServiceIsNULLWhileTesting = true; |
| 222 | 222 |
| 223 // Created lazily upon OnListenerAdded. | 223 // Created lazily upon OnListenerAdded. |
| 224 scoped_ptr<CookiesEventRouter> cookies_event_router_; | 224 scoped_ptr<CookiesEventRouter> cookies_event_router_; |
| 225 | 225 |
| 226 DISALLOW_COPY_AND_ASSIGN(CookiesAPI); | 226 DISALLOW_COPY_AND_ASSIGN(CookiesAPI); |
| 227 }; | 227 }; |
| 228 | 228 |
| 229 } // namespace extensions | 229 } // namespace extensions |
| 230 | 230 |
| 231 #endif // CHROME_BROWSER_EXTENSIONS_API_COOKIES_COOKIES_API_H_ | 231 #endif // CHROME_BROWSER_EXTENSIONS_API_COOKIES_COOKIES_API_H_ |
| OLD | NEW |