gdata: Move IsUnderGDataCacheDirectory() to GDataCache
GDataFileSystem::IsUnderGDataCacheDirectory() is still kept.
This will be removed when we move the ownership of GDataCache
from GDataFileSystem to GDataSystemService.
BUG=131756
TEST=unit_tests --gtest_filter="GData*"
Review URL: https://chromiumcodereview.appspot.com/10541080
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141335 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/chromeos/gdata/gdata_cache.h b/chrome/browser/chromeos/gdata/gdata_cache.h
index 2c3266e..cde682a 100644
--- a/chrome/browser/chromeos/gdata/gdata_cache.h
+++ b/chrome/browser/chromeos/gdata/gdata_cache.h
@@ -13,6 +13,8 @@
#include "base/memory/scoped_ptr.h"
#include "base/threading/sequenced_worker_pool.h"
+class Profile;
+
namespace gdata {
class GDataCache {
@@ -128,6 +130,10 @@
CacheSubDirectoryType sub_dir_type,
CachedFileOrigin file_orign) const;
+ // Returns true if the given path is under gdata cache directory, i.e.
+ // <user_profile_dir>/GCache/v1
+ bool IsUnderGDataCacheDirectory(const FilePath& path) const;
+
// TODO(hashimoto): Remove this method when crbug.com/131756 is fixed.
const std::vector<FilePath>& cache_paths() const { return cache_paths_; }
@@ -166,6 +172,11 @@
base::SequencedWorkerPool* pool,
const base::SequencedWorkerPool::SequenceToken& sequence_token);
+ // Gets the cache root path (i.e. <user_profile_dir>/GCache/v1) from the
+ // profile.
+ // TODO(satorux): Write a unit test for this.
+ static FilePath GetCacheRootPath(Profile* profile);
+
protected:
GDataCache(
const FilePath& cache_root_path,
@@ -177,6 +188,8 @@
void AssertOnSequencedWorkerPool();
private:
+ // The root directory of the cache (i.e. <user_profile_dir>/GCache/v1).
+ const FilePath cache_root_path_;
// Paths for all subdirectories of GCache, one for each
// GDataCache::CacheSubDirectoryType enum.
std::vector<FilePath> cache_paths_;