OLD | NEW |
---|---|
(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 #ifndef CHROME_BROWSER_SAFE_BROWSING_PATH_SANITIZER_H_ | |
6 #define CHROME_BROWSER_SAFE_BROWSING_PATH_SANITIZER_H_ | |
7 | |
8 #include "base/files/file_path.h" | |
9 #include "base/macros.h" | |
10 | |
11 namespace safe_browsing { | |
12 | |
13 // A helper class to sanitize any number of file paths by replacing the portion | |
14 // that represents the current user's home directory with "~". | |
15 class PathSanitizer { | |
16 public: | |
17 PathSanitizer(); | |
18 | |
19 const base::FilePath& GetHomeDirectory() const; | |
20 | |
21 void StripHomeDirectory(base::FilePath* file_path) const; | |
22 void StripHomeDirectory(base::string16* file_path_str) const; | |
grt (UTC plus 2)
2014/06/10 13:47:54
in chromium, we generally don't overload like this
pmonette_google.com
2014/06/10 19:34:39
Done.
| |
23 | |
24 private: | |
25 base::FilePath home_path_; | |
26 | |
27 DISALLOW_COPY_AND_ASSIGN(PathSanitizer); | |
28 }; | |
29 | |
30 } // namespace safe_browsing | |
31 | |
32 #endif // CHROME_BROWSER_SAFE_BROWSING_PATH_SANITIZER_H_ | |
OLD | NEW |