| 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 namespace extensions { | 28 namespace extensions { |
| 29 | 29 |
| 30 // Observes CookieMonster notifications and routes them as events to the | 30 // Observes CookieMonster notifications and routes them as events to the |
| 31 // extension system. | 31 // extension system. |
| 32 class ExtensionCookiesEventRouter : public content::NotificationObserver { | 32 class ExtensionCookiesEventRouter : public content::NotificationObserver { |
| 33 public: | 33 public: |
| 34 explicit ExtensionCookiesEventRouter(Profile* profile); | 34 explicit ExtensionCookiesEventRouter(Profile* profile); |
| 35 virtual ~ExtensionCookiesEventRouter(); | 35 virtual ~ExtensionCookiesEventRouter(); |
| 36 | 36 |
| 37 void Init(); | |
| 38 | |
| 39 private: | 37 private: |
| 40 // content::NotificationObserver implementation. | 38 // content::NotificationObserver implementation. |
| 41 virtual void Observe(int type, | 39 virtual void Observe(int type, |
| 42 const content::NotificationSource& source, | 40 const content::NotificationSource& source, |
| 43 const content::NotificationDetails& details) OVERRIDE; | 41 const content::NotificationDetails& details) OVERRIDE; |
| 44 | 42 |
| 45 // Handler for the COOKIE_CHANGED event. The method takes the details of such | 43 // Handler for the COOKIE_CHANGED event. The method takes the details of such |
| 46 // an event and constructs a suitable JSON formatted extension event from it. | 44 // an event and constructs a suitable JSON formatted extension event from it. |
| 47 void CookieChanged(Profile* profile, ChromeCookieDetails* details); | 45 void CookieChanged(Profile* profile, ChromeCookieDetails* details); |
| 48 | 46 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 186 |
| 189 // ExtensionFunction: | 187 // ExtensionFunction: |
| 190 // GetAllCookieStoresFunction is sync. | 188 // GetAllCookieStoresFunction is sync. |
| 191 virtual void Run() OVERRIDE; | 189 virtual void Run() OVERRIDE; |
| 192 virtual bool RunImpl() OVERRIDE; | 190 virtual bool RunImpl() OVERRIDE; |
| 193 }; | 191 }; |
| 194 | 192 |
| 195 } // namespace extensions | 193 } // namespace extensions |
| 196 | 194 |
| 197 #endif // CHROME_BROWSER_EXTENSIONS_API_COOKIES_COOKIES_API_H_ | 195 #endif // CHROME_BROWSER_EXTENSIONS_API_COOKIES_COOKIES_API_H_ |
| OLD | NEW |