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

Side by Side Diff: chrome/browser/safe_browsing/path_sanitizer.cc

Issue 323953002: Support for recording registered LSPs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@grt
Patch Set: Sync and resolve conflic with trunk Created 6 years, 5 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
(Empty)
1 // Copyright 2014 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/safe_browsing/path_sanitizer.h"
6
7 #include "base/logging.h"
8 #include "base/path_service.h"
9
10 namespace safe_browsing {
11
12 PathSanitizer::PathSanitizer() {
13 // Get the home directory path.
14 if (!PathService::Get(base::DIR_HOME, &home_path_))
15 NOTREACHED();
16 }
17
18 const base::FilePath& PathSanitizer::GetHomeDirectory() const {
19 return home_path_;
20 }
21
22 void PathSanitizer::StripHomeDirectory(base::FilePath* file_path) const {
23 base::FilePath sanitized_path(FILE_PATH_LITERAL("~"));
24
25 // The |file_path| is overwritten only if a relative path is found.
26 if (home_path_.AppendRelativePath(*file_path, &sanitized_path))
27 *file_path = sanitized_path;
28 }
29
30 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/path_sanitizer.h ('k') | chrome/browser/safe_browsing/path_sanitizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698