| 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;
|
|
|