| OLD | NEW |
| 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 "chrome/browser/chromeos/drive/drive_file_system.h" | 5 #include "chrome/browser/chromeos/drive/drive_file_system.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/json/json_file_value_serializer.h" | 9 #include "base/json/json_file_value_serializer.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 // Should be created from the file browser extension API on UI thread. | 385 // Should be created from the file browser extension API on UI thread. |
| 386 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 386 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 387 } | 387 } |
| 388 | 388 |
| 389 void DriveFileSystem::Initialize() { | 389 void DriveFileSystem::Initialize() { |
| 390 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 390 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 391 | 391 |
| 392 drive_service_->Initialize(profile_); | 392 drive_service_->Initialize(profile_); |
| 393 | 393 |
| 394 resource_metadata_.reset(new DriveResourceMetadata); | 394 resource_metadata_.reset(new DriveResourceMetadata); |
| 395 if (!google_apis::util::IsDriveV2ApiEnabled()) |
| 396 resource_metadata_->InitializeRootEntry(kWAPIRootDirectoryResourceId); |
| 397 // If Drive API is enabled, the root directory is initialized after |
| 398 // About resource is obtained. |
| 395 feed_loader_.reset(new DriveFeedLoader(resource_metadata_.get(), | 399 feed_loader_.reset(new DriveFeedLoader(resource_metadata_.get(), |
| 396 drive_service_, | 400 drive_service_, |
| 397 webapps_registry_, | 401 webapps_registry_, |
| 398 cache_, | 402 cache_, |
| 399 blocking_task_runner_)); | 403 blocking_task_runner_)); |
| 400 feed_loader_->AddObserver(this); | 404 feed_loader_->AddObserver(this); |
| 401 | 405 |
| 402 // Allocate the drive operation handlers. | 406 // Allocate the drive operation handlers. |
| 403 drive_operations_.Init(drive_service_, | 407 drive_operations_.Init(drive_service_, |
| 404 this, // DriveFileSystemInterface | 408 this, // DriveFileSystemInterface |
| (...skipping 2135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2540 return; | 2544 return; |
| 2541 } | 2545 } |
| 2542 | 2546 |
| 2543 PlatformFileInfoProto entry_file_info; | 2547 PlatformFileInfoProto entry_file_info; |
| 2544 DriveEntry::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); | 2548 DriveEntry::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); |
| 2545 *entry_proto->mutable_file_info() = entry_file_info; | 2549 *entry_proto->mutable_file_info() = entry_file_info; |
| 2546 callback.Run(DRIVE_FILE_OK, entry_proto.Pass()); | 2550 callback.Run(DRIVE_FILE_OK, entry_proto.Pass()); |
| 2547 } | 2551 } |
| 2548 | 2552 |
| 2549 } // namespace drive | 2553 } // namespace drive |
| OLD | NEW |