| 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 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/browser/extensions/api/cookies/cookies_api_constants.h" | 17 #include "chrome/browser/extensions/api/cookies/cookies_api_constants.h" |
| 18 #include "chrome/browser/extensions/extension_tab_util.h" | 18 #include "chrome/browser/extensions/extension_tab_util.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
| 21 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 21 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 22 #include "chrome/common/extensions/api/cookies.h" | 22 #include "chrome/common/extensions/api/cookies.h" |
| 23 #include "chrome/common/extensions/extension.h" | |
| 24 #include "chrome/common/extensions/permissions/permissions_data.h" | |
| 25 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
| 26 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 25 #include "extensions/common/extension.h" |
| 26 #include "extensions/common/permissions/permissions_data.h" |
| 27 #include "net/cookies/canonical_cookie.h" | 27 #include "net/cookies/canonical_cookie.h" |
| 28 #include "net/cookies/cookie_util.h" | 28 #include "net/cookies/cookie_util.h" |
| 29 #include "url/gurl.h" | 29 #include "url/gurl.h" |
| 30 | 30 |
| 31 using extensions::api::cookies::Cookie; | 31 using extensions::api::cookies::Cookie; |
| 32 using extensions::api::cookies::CookieStore; | 32 using extensions::api::cookies::CookieStore; |
| 33 | 33 |
| 34 namespace GetAll = extensions::api::cookies::GetAll; | 34 namespace GetAll = extensions::api::cookies::GetAll; |
| 35 | 35 |
| 36 namespace extensions { | 36 namespace extensions { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 extensions | 209 } // namespace extensions |
| OLD | NEW |