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

Side by Side Diff: components/drive/chromeos/resource_metadata.cc

Issue 2799603002: Process TeamDrive change in change list. (Closed)
Patch Set: Handle changes to Team Drive by the same path as files, including deletion. Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/drive/chromeos/resource_metadata.h" 5 #include "components/drive/chromeos/resource_metadata.h"
6 6
7 #include <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 206 }
207 207
208 if (google_apis::GetTeamDrivesIntegrationSwitch() == 208 if (google_apis::GetTeamDrivesIntegrationSwitch() ==
209 google_apis::TEAM_DRIVES_INTEGRATION_ENABLED) { 209 google_apis::TEAM_DRIVES_INTEGRATION_ENABLED) {
210 // Initialize "/drive/team_drives". 210 // Initialize "/drive/team_drives".
211 error = storage_->GetEntry(util::kDriveTeamDrivesDirLocalId, &entry); 211 error = storage_->GetEntry(util::kDriveTeamDrivesDirLocalId, &entry);
212 if (error == FILE_ERROR_NOT_FOUND) { 212 if (error == FILE_ERROR_NOT_FOUND) {
213 ResourceEntry team_drives_dir; 213 ResourceEntry team_drives_dir;
214 team_drives_dir.mutable_file_info()->set_is_directory(true); 214 team_drives_dir.mutable_file_info()->set_is_directory(true);
215 team_drives_dir.set_local_id(util::kDriveTeamDrivesDirLocalId); 215 team_drives_dir.set_local_id(util::kDriveTeamDrivesDirLocalId);
216 team_drives_dir.set_resource_id(
217 util::kDriveTeamDrivesDirVirtualResourceId);
216 team_drives_dir.set_parent_local_id(util::kDriveGrandRootLocalId); 218 team_drives_dir.set_parent_local_id(util::kDriveGrandRootLocalId);
217 team_drives_dir.set_title(util::kDriveTeamDrivesDirName); 219 team_drives_dir.set_title(util::kDriveTeamDrivesDirName);
218 error = PutEntryUnderDirectory(team_drives_dir); 220 error = PutEntryUnderDirectory(team_drives_dir);
219 if (error != FILE_ERROR_OK) 221 if (error != FILE_ERROR_OK)
220 return error; 222 return error;
221 } else if (error != FILE_ERROR_OK) { 223 } else if (error != FILE_ERROR_OK) {
222 return error; 224 return error;
223 } 225 }
224 } 226 }
225 227
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 624
623 error = cache_->Remove(id); 625 error = cache_->Remove(id);
624 if (error != FILE_ERROR_OK) 626 if (error != FILE_ERROR_OK)
625 return error; 627 return error;
626 628
627 return storage_->RemoveEntry(id); 629 return storage_->RemoveEntry(id);
628 } 630 }
629 631
630 } // namespace internal 632 } // namespace internal
631 } // namespace drive 633 } // namespace drive
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698