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

Side by Side Diff: chrome/browser/extensions/api/cookies/cookies_helpers.cc

Issue 254763005: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve a merge conflict. Created 6 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 // 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 DCHECK(url.is_valid()); 113 DCHECK(url.is_valid());
114 monster->GetAllCookiesForURLAsync(url, callback); 114 monster->GetAllCookiesForURLAsync(url, callback);
115 } else { 115 } else {
116 monster->GetAllCookiesAsync(callback); 116 monster->GetAllCookiesAsync(callback);
117 } 117 }
118 } 118 }
119 119
120 GURL GetURLFromCanonicalCookie(const net::CanonicalCookie& cookie) { 120 GURL GetURLFromCanonicalCookie(const net::CanonicalCookie& cookie) {
121 const std::string& domain_key = cookie.Domain(); 121 const std::string& domain_key = cookie.Domain();
122 const std::string scheme = 122 const std::string scheme =
123 cookie.IsSecure() ? content::kHttpsScheme : content::kHttpScheme; 123 cookie.IsSecure() ? url::kHttpsScheme : url::kHttpScheme;
124 const std::string host = 124 const std::string host =
125 domain_key.find('.') != 0 ? domain_key : domain_key.substr(1); 125 domain_key.find('.') != 0 ? domain_key : domain_key.substr(1);
126 return GURL(scheme + content::kStandardSchemeSeparator + host + "/"); 126 return GURL(scheme + content::kStandardSchemeSeparator + host + "/");
127 } 127 }
128 128
129 void AppendMatchingCookiesToVector(const net::CookieList& all_cookies, 129 void AppendMatchingCookiesToVector(const net::CookieList& all_cookies,
130 const GURL& url, 130 const GURL& url,
131 const GetAll::Params::Details* details, 131 const GetAll::Params::Details* details,
132 const Extension* extension, 132 const Extension* extension,
133 LinkedCookieVec* match_vector) { 133 LinkedCookieVec* match_vector) {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 if (sub_domain == *details_->domain) 201 if (sub_domain == *details_->domain)
202 return true; 202 return true;
203 const size_t next_dot = sub_domain.find('.', 1); // Skip over leading dot. 203 const size_t next_dot = sub_domain.find('.', 1); // Skip over leading dot.
204 sub_domain.erase(0, next_dot); 204 sub_domain.erase(0, next_dot);
205 } 205 }
206 return false; 206 return false;
207 } 207 }
208 208
209 } // namespace cookies_helpers 209 } // namespace cookies_helpers
210 } // namespace extensions 210 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698