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

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

Issue 347123002: Revert 278655 "Include loaded modules in safe browsing client in..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 6 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
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

Powered by Google App Engine
This is Rietveld 408576698