| 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 // Implements common functionality for the Chrome Extensions Cookies API. | 5 // Implements common functionality for the Chrome Extensions Cookies API. |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/cookies/cookies_helpers.h" | 7 #include "chrome/browser/extensions/api/cookies/cookies_helpers.h" |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 canonical_cookie.Path() : std::string(); | 82 canonical_cookie.Path() : std::string(); |
| 83 cookie->secure = canonical_cookie.IsSecure(); | 83 cookie->secure = canonical_cookie.IsSecure(); |
| 84 cookie->http_only = canonical_cookie.IsHttpOnly(); | 84 cookie->http_only = canonical_cookie.IsHttpOnly(); |
| 85 cookie->session = !canonical_cookie.IsPersistent(); | 85 cookie->session = !canonical_cookie.IsPersistent(); |
| 86 if (canonical_cookie.IsPersistent()) { | 86 if (canonical_cookie.IsPersistent()) { |
| 87 cookie->expiration_date.reset( | 87 cookie->expiration_date.reset( |
| 88 new double(canonical_cookie.ExpiryDate().ToDoubleT())); | 88 new double(canonical_cookie.ExpiryDate().ToDoubleT())); |
| 89 } | 89 } |
| 90 cookie->store_id = store_id; | 90 cookie->store_id = store_id; |
| 91 | 91 |
| 92 return cookie.Pass(); | 92 return cookie; |
| 93 } | 93 } |
| 94 | 94 |
| 95 scoped_ptr<CookieStore> CreateCookieStore(Profile* profile, | 95 scoped_ptr<CookieStore> CreateCookieStore(Profile* profile, |
| 96 base::ListValue* tab_ids) { | 96 base::ListValue* tab_ids) { |
| 97 DCHECK(profile); | 97 DCHECK(profile); |
| 98 DCHECK(tab_ids); | 98 DCHECK(tab_ids); |
| 99 base::DictionaryValue dict; | 99 base::DictionaryValue dict; |
| 100 dict.SetString(keys::kIdKey, GetStoreIdFromProfile(profile)); | 100 dict.SetString(keys::kIdKey, GetStoreIdFromProfile(profile)); |
| 101 dict.Set(keys::kTabIdsKey, tab_ids); | 101 dict.Set(keys::kTabIdsKey, tab_ids); |
| 102 | 102 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 if (sub_domain == *details_->domain) | 203 if (sub_domain == *details_->domain) |
| 204 return true; | 204 return true; |
| 205 const size_t next_dot = sub_domain.find('.', 1); // Skip over leading dot. | 205 const size_t next_dot = sub_domain.find('.', 1); // Skip over leading dot. |
| 206 sub_domain.erase(0, next_dot); | 206 sub_domain.erase(0, next_dot); |
| 207 } | 207 } |
| 208 return false; | 208 return false; |
| 209 } | 209 } |
| 210 | 210 |
| 211 } // namespace cookies_helpers | 211 } // namespace cookies_helpers |
| 212 } // namespace extensions | 212 } // namespace extensions |
| OLD | NEW |