| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/browsing_data_helper.h" |
| 6 |
| 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/common/url_constants.h" |
| 9 #include "content/public/browser/child_process_security_policy.h" |
| 10 #include "googleurl/src/gurl.h" |
| 11 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 12 |
| 13 // Static |
| 14 bool BrowsingDataHelper::IsValidScheme(const std::string& scheme) { |
| 15 content::ChildProcessSecurityPolicy* policy = |
| 16 content::ChildProcessSecurityPolicy::GetInstance(); |
| 17 return (policy->IsWebSafeScheme(scheme) && |
| 18 scheme != chrome::kChromeDevToolsScheme && |
| 19 scheme != chrome::kExtensionScheme); |
| 20 } |
| 21 |
| 22 // Static |
| 23 bool BrowsingDataHelper::IsValidScheme(const WebKit::WebString& scheme) { |
| 24 return BrowsingDataHelper::IsValidScheme(UTF16ToUTF8(scheme)); |
| 25 } |
| 26 |
| 27 // Static |
| 28 bool BrowsingDataHelper::HasValidScheme(const GURL& origin) { |
| 29 return BrowsingDataHelper::IsValidScheme(origin.scheme()); |
| 30 } |
| OLD | NEW |