summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/gdata/gdata_files.cc
diff options
context:
space:
mode:
authortbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 02:55:44 +0000
committertbarzic@chromium.org <tbarzic@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-19 02:55:44 +0000
commitf98ac64588453aec3fc63070c5d3a4d96662221a (patch)
tree4ed89c558ca6b7707fa0e2296827f74494e499b1 /chrome/browser/chromeos/gdata/gdata_files.cc
parent146be2e5165365b500fd573769c4fb53343d6276 (diff)
downloadchromium_src-f98ac64588453aec3fc63070c5d3a4d96662221a.zip
chromium_src-f98ac64588453aec3fc63070c5d3a4d96662221a.tar.gz
chromium_src-f98ac64588453aec3fc63070c5d3a4d96662221a.tar.bz2
Remove (hacky) handling for drive/.search paths from gdata file system.
We don't need this anymore. NOTE: this shouldn't go in before: http://codereview.chromium.org/10539165/ TEST=existing tests. (manual: confirmed drive search still works in file browser) BUG=129068 Review URL: https://chromiumcodereview.appspot.com/10562016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142906 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/gdata/gdata_files.cc')
-rw-r--r--chrome/browser/chromeos/gdata/gdata_files.cc68
1 files changed, 0 insertions, 68 deletions
diff --git a/chrome/browser/chromeos/gdata/gdata_files.cc b/chrome/browser/chromeos/gdata/gdata_files.cc
index fbb4e7e..67e65dc 100644
--- a/chrome/browser/chromeos/gdata/gdata_files.cc
+++ b/chrome/browser/chromeos/gdata/gdata_files.cc
@@ -396,7 +396,6 @@ void GDataDirectory::RemoveChildDirectories() {
GDataRootDirectory::GDataRootDirectory()
: ALLOW_THIS_IN_INITIALIZER_LIST(GDataDirectory(NULL, this)),
- fake_search_directory_(new GDataDirectory(NULL, NULL)),
largest_changestamp_(0), serialized_size_(0) {
title_ = kGDataRootDirectory;
SetFileNameFromTitle();
@@ -430,54 +429,6 @@ void GDataRootDirectory::RemoveEntryFromResourceMap(GDataEntry* entry) {
resource_map_.erase(entry->resource_id());
}
-bool GDataRootDirectory::ModifyFindEntryParamsForSearchPath(
- const FilePath& file_path,
- std::vector<FilePath::StringType>* components,
- GDataDirectory** current_dir,
- FilePath* directory_path) {
- DCHECK(current_dir);
- DCHECK(components);
- // |components| should contain at least 4 members.
- // "drive", ".search", query_name and query_result_name. Additionally,
- // if query result is a directory, it may contain subdirectories and files,
- // in which case the number of components may be bigger than 4.
- DCHECK_GT(components->size(), 3u);
- DCHECK(components->at(0) == "drive" && components->at(1) == ".search");
-
- FilePath::StringType resource_id;
- FilePath::StringType file_name;
- if (!util::ParseSearchFileName((*components)[3], &resource_id, &file_name))
- return false;
-
- GDataEntry* file_entry = GetEntryByResourceId(resource_id);
- if (!file_entry)
- return false;
-
- // We should continue search from the entry's parent dir (|current_dir|), so
- // we have to ammend |components| to be relative to the |current_dir|
- // (including the dir itself).
- // We continue the search with the entry's parent instead of the entry itself
- // to make sure that the returned file really has the name |file_name|. Note
- // that we may end up with finding an entry even if entry with |resource_id|
- // has a name different from |file_name|. This is intended, and enables us to
- // test that new file name is unique (in file manager) when renaming the
- // entry.
- DCHECK(file_entry->parent());
- *current_dir = file_entry->parent();
-
- if ((*current_dir)->parent()) {
- *directory_path = (*current_dir)->parent()->GetFilePath();
- } else {
- *directory_path = FilePath();
- }
-
- // Remove "drive/.search" from path.
- components->erase(components->begin(), components->begin() + 2);
- (*components)[0] = (*current_dir)->file_name();
- (*components)[1] = file_name;
- return true;
-}
-
void GDataRootDirectory::FindEntryByPath(const FilePath& file_path,
const FindEntryCallback& callback) {
// GDataFileSystem has already locked.
@@ -489,25 +440,6 @@ void GDataRootDirectory::FindEntryByPath(const FilePath& file_path,
GDataDirectory* current_dir = this;
FilePath directory_path;
- util::GDataSearchPathType path_type =
- util::GetSearchPathStatusForPathComponents(components);
-
- if (path_type == util::GDATA_SEARCH_PATH_ROOT ||
- path_type == util::GDATA_SEARCH_PATH_QUERY) {
- callback.Run(base::PLATFORM_FILE_OK, fake_search_directory_.get());
- return;
- }
-
- // If the path is under search path, we have to modify paremeters for finding
- // the entry.
- if (path_type != util::GDATA_SEARCH_PATH_INVALID) {
- if (!ModifyFindEntryParamsForSearchPath(file_path,
- &components, &current_dir, &directory_path)) {
- callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, NULL);
- return;
- }
- }
-
for (size_t i = 0; i < components.size() && current_dir; i++) {
directory_path = directory_path.Append(current_dir->file_name());