| 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 if (filter.MatchesCookie(cookie)) | 154 if (filter.MatchesCookie(cookie)) |
| 155 match_vector->push_back(CreateCookie(cookie, *details->store_id)); | 155 match_vector->push_back(CreateCookie(cookie, *details->store_id)); |
| 156 } | 156 } |
| 157 } | 157 } |
| 158 | 158 |
| 159 void AppendToTabIdList(Browser* browser, base::ListValue* tab_ids) { | 159 void AppendToTabIdList(Browser* browser, base::ListValue* tab_ids) { |
| 160 DCHECK(browser); | 160 DCHECK(browser); |
| 161 DCHECK(tab_ids); | 161 DCHECK(tab_ids); |
| 162 TabStripModel* tab_strip = browser->tab_strip_model(); | 162 TabStripModel* tab_strip = browser->tab_strip_model(); |
| 163 for (int i = 0; i < tab_strip->count(); ++i) { | 163 for (int i = 0; i < tab_strip->count(); ++i) { |
| 164 tab_ids->Append(new base::FundamentalValue( | 164 tab_ids->AppendInteger( |
| 165 ExtensionTabUtil::GetTabId(tab_strip->GetWebContentsAt(i)))); | 165 ExtensionTabUtil::GetTabId(tab_strip->GetWebContentsAt(i))); |
| 166 } | 166 } |
| 167 } | 167 } |
| 168 | 168 |
| 169 MatchFilter::MatchFilter(const GetAll::Params::Details* details) | 169 MatchFilter::MatchFilter(const GetAll::Params::Details* details) |
| 170 : details_(details) { | 170 : details_(details) { |
| 171 DCHECK(details_); | 171 DCHECK(details_); |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool MatchFilter::MatchesCookie( | 174 bool MatchFilter::MatchesCookie( |
| 175 const net::CanonicalCookie& cookie) { | 175 const net::CanonicalCookie& cookie) { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 if (sub_domain == *details_->domain) | 210 if (sub_domain == *details_->domain) |
| 211 return true; | 211 return true; |
| 212 const size_t next_dot = sub_domain.find('.', 1); // Skip over leading dot. | 212 const size_t next_dot = sub_domain.find('.', 1); // Skip over leading dot. |
| 213 sub_domain.erase(0, next_dot); | 213 sub_domain.erase(0, next_dot); |
| 214 } | 214 } |
| 215 return false; | 215 return false; |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace cookies_helpers | 218 } // namespace cookies_helpers |
| 219 } // namespace extensions | 219 } // namespace extensions |
| OLD | NEW |