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

Unified Diff: chrome/browser/chromeos/drive/drive_file_system.cc

Issue 11227020: Set root resource ID upon full feed update. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a comment. Created 8 years, 2 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: chrome/browser/chromeos/drive/drive_file_system.cc
diff --git a/chrome/browser/chromeos/drive/drive_file_system.cc b/chrome/browser/chromeos/drive/drive_file_system.cc
index 908001e88b68d23ffaab95aff5556303a75d19a6..0c35c357f9a3b462290165c2f89debcdcec5c8b8 100644
--- a/chrome/browser/chromeos/drive/drive_file_system.cc
+++ b/chrome/browser/chromeos/drive/drive_file_system.cc
@@ -42,6 +42,12 @@ using content::BrowserThread;
namespace drive {
namespace {
+// The resource ID for the root directory for WAPI is defined in the spec:
+// https://developers.google.com/google-apps/documents-list/
+// Note that this special ID only applies to WAPI. Drive uses a non-constant
+// unique ID given in About resource.
+const char kWAPIRootDirectoryResourceId[] = "folder:root";
+
const char kMimeTypeJson[] = "application/json";
const char kEmptyFilePath[] = "/dev/null";
@@ -392,6 +398,10 @@ void DriveFileSystem::Initialize() {
drive_service_->Initialize(profile_);
resource_metadata_.reset(new DriveResourceMetadata);
+ if (!google_apis::util::IsDriveV2ApiEnabled())
+ resource_metadata_->InitializeRootEntry(kWAPIRootDirectoryResourceId);
+ // If Drive API is enabled, the root directory is initialized after
+ // About resource is obtained.
feed_loader_.reset(new DriveFeedLoader(resource_metadata_.get(),
drive_service_,
webapps_registry_,

Powered by Google App Engine
This is Rietveld 408576698