Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: chrome/browser/extensions/extension_cookies_helpers.h

Issue 10375021: Move Extension into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Take 2 Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 common functionality used by the implementation of the Chrome 5 // Defines common functionality used by the implementation of the Chrome
6 // Extensions Cookies API implemented in 6 // Extensions Cookies API implemented in
7 // chrome/browser/extensions/extension_cookies_api.cc. This separate interface 7 // chrome/browser/extensions/extension_cookies_api.cc. This separate interface
8 // exposes pieces of the API implementation mainly for unit testing purposes. 8 // exposes pieces of the API implementation mainly for unit testing purposes.
9 9
10 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_COOKIES_HELPERS_H_ 10 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_COOKIES_HELPERS_H_
11 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_COOKIES_HELPERS_H_ 11 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_COOKIES_HELPERS_H_
12 #pragma once 12 #pragma once
13 13
14 #include <string> 14 #include <string>
15 15
16 #include "net/cookies/cookie_monster.h" 16 #include "net/cookies/cookie_monster.h"
17 17
18 class Browser; 18 class Browser;
19 class Extension;
20 class Profile; 19 class Profile;
21 20
22 namespace base { 21 namespace base {
23 class DictionaryValue; 22 class DictionaryValue;
24 class ListValue; 23 class ListValue;
25 } 24 }
26 25
26 namespace extensions {
27 class Extension;
28 }
29
27 namespace extension_cookies_helpers { 30 namespace extension_cookies_helpers {
28 31
29 // Returns either the original profile or the incognito profile, based on the 32 // Returns either the original profile or the incognito profile, based on the
30 // given store ID. Returns NULL if the profile doesn't exist or is not allowed 33 // given store ID. Returns NULL if the profile doesn't exist or is not allowed
31 // (e.g. if incognito mode is not enabled for the extension). 34 // (e.g. if incognito mode is not enabled for the extension).
32 Profile* ChooseProfileFromStoreId(const std::string& store_id, 35 Profile* ChooseProfileFromStoreId(const std::string& store_id,
33 Profile* profile, 36 Profile* profile,
34 bool include_incognito); 37 bool include_incognito);
35 38
36 // Returns the store ID for a particular user profile. 39 // Returns the store ID for a particular user profile.
(...skipping 26 matching lines...) Expand all
63 GURL GetURLFromCanonicalCookie( 66 GURL GetURLFromCanonicalCookie(
64 const net::CookieMonster::CanonicalCookie& cookie); 67 const net::CookieMonster::CanonicalCookie& cookie);
65 68
66 // Looks through all cookies in the given cookie store, and appends to the 69 // Looks through all cookies in the given cookie store, and appends to the
67 // match list all the cookies that both match the given URL and cookie details 70 // match list all the cookies that both match the given URL and cookie details
68 // and are allowed by extension host permissions. 71 // and are allowed by extension host permissions.
69 void AppendMatchingCookiesToList( 72 void AppendMatchingCookiesToList(
70 const net::CookieList& all_cookies, 73 const net::CookieList& all_cookies,
71 const std::string& store_id, 74 const std::string& store_id,
72 const GURL& url, const base::DictionaryValue* details, 75 const GURL& url, const base::DictionaryValue* details,
73 const Extension* extension, 76 const extensions::Extension* extension,
74 base::ListValue* match_list); 77 base::ListValue* match_list);
75 78
76 // Appends the IDs of all tabs belonging to the given browser to the 79 // Appends the IDs of all tabs belonging to the given browser to the
77 // given list. 80 // given list.
78 void AppendToTabIdList(Browser* browser, base::ListValue* tab_ids); 81 void AppendToTabIdList(Browser* browser, base::ListValue* tab_ids);
79 82
80 // A class representing the cookie filter parameters passed into 83 // A class representing the cookie filter parameters passed into
81 // cookies.getAll(). 84 // cookies.getAll().
82 // This class is essentially a convenience wrapper for the details dictionary 85 // This class is essentially a convenience wrapper for the details dictionary
83 // passed into the cookies.getAll() API by the user. If the dictionary contains 86 // passed into the cookies.getAll() API by the user. If the dictionary contains
(...skipping 29 matching lines...) Expand all
113 // as '.foo.bar.com', and both will match cookies with domain values of 116 // as '.foo.bar.com', and both will match cookies with domain values of
114 // 'foo.bar.com', '.foo.bar.com', and 'baz.foo.bar.com'. 117 // 'foo.bar.com', '.foo.bar.com', and 'baz.foo.bar.com'.
115 bool MatchesDomain(const std::string& domain); 118 bool MatchesDomain(const std::string& domain);
116 119
117 const base::DictionaryValue* details_; 120 const base::DictionaryValue* details_;
118 }; 121 };
119 122
120 } // namespace extension_cookies_helpers 123 } // namespace extension_cookies_helpers
121 124
122 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_COOKIES_HELPERS_H_ 125 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_COOKIES_HELPERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698