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

Side by Side Diff: chrome/browser/browsing_data_helper.cc

Issue 9958111: Adding a BrowsingDataHelper class to hold some useful methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase onto trunk. Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browsing_data_helper.h ('k') | chrome/browser/browsing_data_helper_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « chrome/browser/browsing_data_helper.h ('k') | chrome/browser/browsing_data_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698