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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 CreateCookie(*it, *details->store_id).release())); | 144 CreateCookie(*it, *details->store_id).release())); |
145 } | 145 } |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 void AppendToTabIdList(Browser* browser, base::ListValue* tab_ids) { | 149 void AppendToTabIdList(Browser* browser, base::ListValue* tab_ids) { |
150 DCHECK(browser); | 150 DCHECK(browser); |
151 DCHECK(tab_ids); | 151 DCHECK(tab_ids); |
152 TabStripModel* tab_strip = browser->tab_strip_model(); | 152 TabStripModel* tab_strip = browser->tab_strip_model(); |
153 for (int i = 0; i < tab_strip->count(); ++i) { | 153 for (int i = 0; i < tab_strip->count(); ++i) { |
154 tab_ids->Append(Value::CreateIntegerValue( | 154 tab_ids->Append(new base::FundamentalValue( |
155 ExtensionTabUtil::GetTabId(tab_strip->GetWebContentsAt(i)))); | 155 ExtensionTabUtil::GetTabId(tab_strip->GetWebContentsAt(i)))); |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 MatchFilter::MatchFilter(const GetAll::Params::Details* details) | 159 MatchFilter::MatchFilter(const GetAll::Params::Details* details) |
160 : details_(details) { | 160 : details_(details) { |
161 DCHECK(details_); | 161 DCHECK(details_); |
162 } | 162 } |
163 | 163 |
164 bool MatchFilter::MatchesCookie( | 164 bool MatchFilter::MatchesCookie( |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 sub_domain.length() >= details_->domain->length();) { | 199 sub_domain.length() >= details_->domain->length();) { |
200 if (sub_domain == *details_->domain) | 200 if (sub_domain == *details_->domain) |
201 return true; | 201 return true; |
202 const size_t next_dot = sub_domain.find('.', 1); // Skip over leading dot. | 202 const size_t next_dot = sub_domain.find('.', 1); // Skip over leading dot. |
203 sub_domain.erase(0, next_dot); | 203 sub_domain.erase(0, next_dot); |
204 } | 204 } |
205 return false; | 205 return false; |
206 } | 206 } |
207 | 207 |
208 } // namespace cookies_helpers | 208 } // namespace cookies_helpers |
209 } // namespace extension | 209 } // namespace extensions |
OLD | NEW |