Chromium Code Reviews| Index: chrome/browser/chromeos/gdata/gdata_file_system.cc |
| =================================================================== |
| --- chrome/browser/chromeos/gdata/gdata_file_system.cc (revision 133890) |
| +++ chrome/browser/chromeos/gdata/gdata_file_system.cc (working copy) |
| @@ -54,7 +54,6 @@ |
| const char kMimeTypeJson[] = "application/json"; |
| const char kMimeTypeOctetStream[] = "application/octet-stream"; |
| -const FilePath::CharType kGDataRootDirectory[] = FILE_PATH_LITERAL("gdata"); |
| const char kWildCard[] = "*"; |
| const char kLocallyModifiedFileExtension[] = "local"; |
| const char kMountedArchiveFileExtension[] = "mounted"; |
| @@ -416,13 +415,12 @@ |
| if (!dir) |
| return; |
| - for (GDataFileCollection::const_iterator it = dir->children().begin(); |
| - it != dir->children().end(); ++it) { |
| - GDataDirectory* child_dir = it->second->AsGDataDirectory(); |
| - if (child_dir) { |
| - changed_dirs->insert(child_dir->GetFilePath()); |
| - GetChildDirectoryPaths(child_dir, changed_dirs); |
| - } |
| + for (GDataDirectoryCollection::const_iterator it = |
| + dir->child_directories().begin(); |
| + it != dir->child_directories().end(); ++it) { |
| + GDataDirectory* child_dir = it->second; |
| + changed_dirs->insert(child_dir->GetFilePath()); |
| + GetChildDirectoryPaths(child_dir, changed_dirs); |
| } |
| } |
| @@ -845,7 +843,6 @@ |
| documents_service_->Initialize(profile_); |
| root_.reset(new GDataRootDirectory); |
| - root_->set_file_name(kGDataRootDirectory); |
| PrefService* pref_service = profile_->GetPrefs(); |
| hide_hosted_docs_ = pref_service->GetBoolean(prefs::kDisableGDataHostedFiles); |
| @@ -2554,6 +2551,10 @@ |
| // After changing the title of the entry, call TakeFile() to remove the |
| // entry from its parent directory and then add it back in order to go |
| // through the file name de-duplication. |
| + // TODO(achuith/satorux/zel): This code is fragile. The title has been |
| + // changed, but not the file_name. TakeEntry removes the child based on the |
| + // old file_name, and then re-adds the child by first assigning the new title |
| + // to file_name. |
|
satorux1
2012/04/27 22:29:41
file a bug and add a URL?
achuithb
2012/04/27 22:43:22
Done.
|
| if (!entry->parent()->TakeEntry(entry)) |
| return base::PLATFORM_FILE_ERROR_FAILED; |