| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 void RemoveCookieOnIOThread(); | 148 void RemoveCookieOnIOThread(); |
| 149 void RespondOnUIThread(); | 149 void RespondOnUIThread(); |
| 150 void RemoveCookieCallback(); | 150 void RemoveCookieCallback(); |
| 151 | 151 |
| 152 GURL url_; | 152 GURL url_; |
| 153 scoped_refptr<net::URLRequestContextGetter> store_browser_context_; | 153 scoped_refptr<net::URLRequestContextGetter> store_browser_context_; |
| 154 std::unique_ptr<api::cookies::Remove::Params> parsed_args_; | 154 std::unique_ptr<api::cookies::Remove::Params> parsed_args_; |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 // Implements the cookies.getAllCookieStores() extension function. | 157 // Implements the cookies.getAllCookieStores() extension function. |
| 158 class CookiesGetAllCookieStoresFunction : public ChromeSyncExtensionFunction { | 158 class CookiesGetAllCookieStoresFunction : public UIThreadExtensionFunction { |
| 159 public: | 159 public: |
| 160 DECLARE_EXTENSION_FUNCTION("cookies.getAllCookieStores", | 160 DECLARE_EXTENSION_FUNCTION("cookies.getAllCookieStores", |
| 161 COOKIES_GETALLCOOKIESTORES) | 161 COOKIES_GETALLCOOKIESTORES) |
| 162 | 162 |
| 163 protected: | 163 protected: |
| 164 ~CookiesGetAllCookieStoresFunction() override {} | 164 ~CookiesGetAllCookieStoresFunction() override {} |
| 165 | 165 |
| 166 // ExtensionFunction: | 166 // ExtensionFunction: |
| 167 bool RunSync() override; | 167 ResponseAction Run() override; |
| 168 }; | 168 }; |
| 169 | 169 |
| 170 class CookiesAPI : public BrowserContextKeyedAPI, public EventRouter::Observer { | 170 class CookiesAPI : public BrowserContextKeyedAPI, public EventRouter::Observer { |
| 171 public: | 171 public: |
| 172 explicit CookiesAPI(content::BrowserContext* context); | 172 explicit CookiesAPI(content::BrowserContext* context); |
| 173 ~CookiesAPI() override; | 173 ~CookiesAPI() override; |
| 174 | 174 |
| 175 // KeyedService implementation. | 175 // KeyedService implementation. |
| 176 void Shutdown() override; | 176 void Shutdown() override; |
| 177 | 177 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 194 | 194 |
| 195 // Created lazily upon OnListenerAdded. | 195 // Created lazily upon OnListenerAdded. |
| 196 std::unique_ptr<CookiesEventRouter> cookies_event_router_; | 196 std::unique_ptr<CookiesEventRouter> cookies_event_router_; |
| 197 | 197 |
| 198 DISALLOW_COPY_AND_ASSIGN(CookiesAPI); | 198 DISALLOW_COPY_AND_ASSIGN(CookiesAPI); |
| 199 }; | 199 }; |
| 200 | 200 |
| 201 } // namespace extensions | 201 } // namespace extensions |
| 202 | 202 |
| 203 #endif // CHROME_BROWSER_EXTENSIONS_API_COOKIES_COOKIES_API_H_ | 203 #endif // CHROME_BROWSER_EXTENSIONS_API_COOKIES_COOKIES_API_H_ |
| OLD | NEW |