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

Unified Diff: chrome/browser/chromeos/gdata/gdata_file_system.cc

Issue 10693109: Use Drive v2 API: enable behind --enable-drive-api flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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/gdata/gdata_file_system.cc
diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.cc b/chrome/browser/chromeos/gdata/gdata_file_system.cc
index 402be279ac4f0e0f72156df832e68debfbb97651..5f69ee87db9b577142199839df26486d6dabc8fc 100644
--- a/chrome/browser/chromeos/gdata/gdata_file_system.cc
+++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc
@@ -673,15 +673,18 @@ GDataFileSystem::GDataFileSystem(
hide_hosted_docs_(false),
ui_weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)),
ui_weak_ptr_(ui_weak_ptr_factory_.GetWeakPtr()),
- sequence_token_(sequence_token) {
+ sequence_token_(sequence_token),
+ use_drive_api_(false) {
// Should be created from the file browser extension API on UI thread.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
}
-void GDataFileSystem::Initialize() {
+void GDataFileSystem::Initialize(bool use_drive_api) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- documents_service_->Initialize(profile_);
+ use_drive_api_ = use_drive_api;
+
+ documents_service_->Initialize(profile_, use_drive_api_);
root_.reset(new GDataRootDirectory);
@@ -888,7 +891,8 @@ void GDataFileSystem::OnGetAccountMetadata(
scoped_ptr<AccountMetadataFeed> account_metadata;
if (feed_data.get()) {
- account_metadata = AccountMetadataFeed::CreateFrom(*feed_data);
+ account_metadata = AccountMetadataFeed::CreateFrom(*feed_data,
+ use_drive_api_);
#ifndef NDEBUG
// Save account metadata feed for analysis.
const FilePath path =
@@ -915,7 +919,8 @@ void GDataFileSystem::OnGetAccountMetadata(
return;
}
- webapps_registry_->UpdateFromFeed(account_metadata.get());
+ if (!use_drive_api_)
+ webapps_registry_->UpdateFromFeed(account_metadata.get());
bool changes_detected = true;
if (local_changestamp >= account_metadata->largest_changestamp()) {
@@ -2433,7 +2438,7 @@ void GDataFileSystem::OnGetAvailableSpace(
scoped_ptr<AccountMetadataFeed> feed;
if (data.get())
- feed = AccountMetadataFeed::CreateFrom(*data);
+ feed = AccountMetadataFeed::CreateFrom(*data, use_drive_api_);
if (!feed.get()) {
callback.Run(base::PLATFORM_FILE_ERROR_FAILED, -1, -1);
return;

Powered by Google App Engine
This is Rietveld 408576698