| 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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 base::SequencedTaskRunner* blocking_task_runner) | 306 base::SequencedTaskRunner* blocking_task_runner) |
| 307 : profile_(profile), | 307 : profile_(profile), |
| 308 cache_(cache), | 308 cache_(cache), |
| 309 uploader_(uploader), | 309 uploader_(uploader), |
| 310 drive_service_(drive_service), | 310 drive_service_(drive_service), |
| 311 webapps_registry_(webapps_registry), | 311 webapps_registry_(webapps_registry), |
| 312 update_timer_(true /* retain_user_task */, true /* is_repeating */), | 312 update_timer_(true /* retain_user_task */, true /* is_repeating */), |
| 313 last_update_check_error_(DRIVE_FILE_OK), | 313 last_update_check_error_(DRIVE_FILE_OK), |
| 314 hide_hosted_docs_(false), | 314 hide_hosted_docs_(false), |
| 315 blocking_task_runner_(blocking_task_runner), | 315 blocking_task_runner_(blocking_task_runner), |
| 316 scheduler_(new DriveScheduler(profile, &drive_operations_)), | 316 scheduler_(new DriveScheduler(profile, |
| 317 drive_service, |
| 318 &drive_operations_)), |
| 317 polling_interval_sec_(kFastPollingIntervalInSec), | 319 polling_interval_sec_(kFastPollingIntervalInSec), |
| 318 push_notification_enabled_(false), | 320 push_notification_enabled_(false), |
| 319 ALLOW_THIS_IN_INITIALIZER_LIST(ui_weak_ptr_factory_(this)), | 321 ALLOW_THIS_IN_INITIALIZER_LIST(ui_weak_ptr_factory_(this)), |
| 320 ui_weak_ptr_(ui_weak_ptr_factory_.GetWeakPtr()) { | 322 ui_weak_ptr_(ui_weak_ptr_factory_.GetWeakPtr()) { |
| 321 // Should be created from the file browser extension API on UI thread. | 323 // Should be created from the file browser extension API on UI thread. |
| 322 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 324 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 323 } | 325 } |
| 324 | 326 |
| 325 void DriveFileSystem::Reload() { | 327 void DriveFileSystem::Reload() { |
| 326 ResetResourceMetadata(); | 328 ResetResourceMetadata(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 344 | 346 |
| 345 scheduler_->Initialize(); | 347 scheduler_->Initialize(); |
| 346 | 348 |
| 347 InitializePreferenceObserver(); | 349 InitializePreferenceObserver(); |
| 348 } | 350 } |
| 349 | 351 |
| 350 void DriveFileSystem::ResetResourceMetadata() { | 352 void DriveFileSystem::ResetResourceMetadata() { |
| 351 resource_metadata_.reset(new DriveResourceMetadata); | 353 resource_metadata_.reset(new DriveResourceMetadata); |
| 352 feed_loader_.reset(new DriveFeedLoader(resource_metadata_.get(), | 354 feed_loader_.reset(new DriveFeedLoader(resource_metadata_.get(), |
| 353 drive_service_, | 355 drive_service_, |
| 356 scheduler_.get(), |
| 354 webapps_registry_, | 357 webapps_registry_, |
| 355 cache_, | 358 cache_, |
| 356 blocking_task_runner_)); | 359 blocking_task_runner_)); |
| 357 feed_loader_->AddObserver(this); | 360 feed_loader_->AddObserver(this); |
| 358 | 361 |
| 359 // Allocate the drive operation handlers. | 362 // Allocate the drive operation handlers. |
| 360 drive_operations_.Init(drive_service_, | 363 drive_operations_.Init(drive_service_, |
| 361 this, // DriveFileSystemInterface | 364 this, // DriveFileSystemInterface |
| 362 cache_, | 365 cache_, |
| 363 resource_metadata_.get(), | 366 resource_metadata_.get(), |
| (...skipping 1898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2262 return; | 2265 return; |
| 2263 } | 2266 } |
| 2264 | 2267 |
| 2265 PlatformFileInfoProto entry_file_info; | 2268 PlatformFileInfoProto entry_file_info; |
| 2266 util::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); | 2269 util::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); |
| 2267 *entry_proto->mutable_file_info() = entry_file_info; | 2270 *entry_proto->mutable_file_info() = entry_file_info; |
| 2268 callback.Run(DRIVE_FILE_OK, entry_proto.Pass()); | 2271 callback.Run(DRIVE_FILE_OK, entry_proto.Pass()); |
| 2269 } | 2272 } |
| 2270 | 2273 |
| 2271 } // namespace drive | 2274 } // namespace drive |
| OLD | NEW |