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

Unified Diff: base/file_path.cc

Issue 16805: Move Contains() method to file_utils, stop relying on in extensions_protocol (Closed)
Patch Set: Review feedback Created 11 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: base/file_path.cc
diff --git a/base/file_path.cc b/base/file_path.cc
index 8738c37ac59c6767b57e87eb5e1db8dc93fc822f..3375b66727863046c3e9451790de0cbbdf21287c 100644
--- a/base/file_path.cc
+++ b/base/file_path.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "base/file_path.h"
-#include "base/file_util.h"
Erik does not do reviews 2009/01/12 17:14:05 maybe it's worth adding a comment here so that oth
#include "base/logging.h"
// These includes are just for the *Hack functions, and should be removed
@@ -257,31 +256,6 @@ bool FilePath::IsAbsolute() const {
return IsPathAbsolute(path_);
}
-bool FilePath::Contains(const FilePath &other) const {
- FilePath parent = FilePath(*this);
- FilePath child = FilePath(other);
-
- if (!file_util::AbsolutePath(&parent) || !file_util::AbsolutePath(&child))
- return false;
-
-#if defined(OS_WIN)
- // file_util::AbsolutePath() does not flatten case on Windows, so we must do
- // a case-insensitive compare.
- if (!StartsWith(child.value(), parent.value(), false))
-#else
- if (!StartsWithASCII(child.value(), parent.value(), true))
-#endif
- return false;
-
- // file_util::AbsolutePath() normalizes '/' to '\' on Windows, so we only need
- // to check kSeparators[0].
- if (child.value().length() <= parent.value().length() ||
- child.value()[parent.value().length()] != kSeparators[0])
- return false;
-
- return true;
-}
-
#if defined(OS_POSIX)
// See file_path.h for a discussion of the encoding of paths on POSIX
// platforms. These *Hack() functions are not quite correct, but they're
« no previous file with comments | « base/file_path.h ('k') | base/file_path_unittest.cc » ('j') | base/file_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698