| // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| |
| #include <vector> |
| |
| #include "base/stl_util.h" |
| #include "base/strings/utf_string_conversions.h" |
| #include "extensions/common/constants.h" |
| #include "url/gurl.h" |
| #include "url/url_util.h" |
| |
| // Static |
| bool BrowsingDataHelper::IsWebScheme(const std::string& scheme) { |
| const std::vector<std::string>& schemes = url::GetWebStorageSchemes(); |
| return base::ContainsValue(schemes, scheme); |
| } |
| |
| // Static |
| bool BrowsingDataHelper::HasWebScheme(const GURL& origin) { |
| return BrowsingDataHelper::IsWebScheme(origin.scheme()); |
| } |
| |
| // Static |
| bool BrowsingDataHelper::IsExtensionScheme(const std::string& scheme) { |
| return scheme == extensions::kExtensionScheme; |
| } |
| |
| // Static |
| bool BrowsingDataHelper::HasExtensionScheme(const GURL& origin) { |
| return BrowsingDataHelper::IsExtensionScheme(origin.scheme()); |
| } |