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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(CookiesEventRouter); | 60 DISALLOW_COPY_AND_ASSIGN(CookiesEventRouter); |
61 }; | 61 }; |
62 | 62 |
63 // Serves as a base class for all cookies API functions, and defines some | 63 // Serves as a base class for all cookies API functions, and defines some |
64 // common functionality for parsing cookies API function arguments. | 64 // common functionality for parsing cookies API function arguments. |
65 // Note that all of the functions in this file derive from | 65 // Note that all of the functions in this file derive from |
66 // AsyncExtensionFunction, and are not threadsafe, so they should not be | 66 // AsyncExtensionFunction, and are not threadsafe, so they should not be |
67 // concurrently accessed from multiple threads. They modify |result_| and other | 67 // concurrently accessed from multiple threads. They modify |result_| and other |
68 // member variables directly. | 68 // member variables directly. |
69 // See chrome/browser/extensions/extension_function.h for more information. | 69 // See extensions/browser/extension_function.h for more information. |
70 class CookiesFunction : public ChromeAsyncExtensionFunction { | 70 class CookiesFunction : public ChromeAsyncExtensionFunction { |
71 protected: | 71 protected: |
72 virtual ~CookiesFunction() {} | 72 virtual ~CookiesFunction() {} |
73 | 73 |
74 // Constructs a GURL from the given url string. Returns false and assigns the | 74 // Constructs a GURL from the given url string. Returns false and assigns the |
75 // internal error_ value if the URL is invalid. If |check_host_permissions| is | 75 // internal error_ value if the URL is invalid. If |check_host_permissions| is |
76 // true, the URL is also checked against the extension's host permissions, and | 76 // true, the URL is also checked against the extension's host permissions, and |
77 // if there is no permission for the URL, this function returns false. | 77 // if there is no permission for the URL, this function returns false. |
78 bool ParseUrl(const std::string& url_string, GURL* url, | 78 bool ParseUrl(const std::string& url_string, GURL* url, |
79 bool check_host_permissions); | 79 bool check_host_permissions); |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |