| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 base::SequencedTaskRunner* blocking_task_runner) | 298 base::SequencedTaskRunner* blocking_task_runner) |
| 299 : profile_(profile), | 299 : profile_(profile), |
| 300 cache_(cache), | 300 cache_(cache), |
| 301 uploader_(uploader), | 301 uploader_(uploader), |
| 302 drive_service_(drive_service), | 302 drive_service_(drive_service), |
| 303 webapps_registry_(webapps_registry), | 303 webapps_registry_(webapps_registry), |
| 304 update_timer_(true /* retain_user_task */, true /* is_repeating */), | 304 update_timer_(true /* retain_user_task */, true /* is_repeating */), |
| 305 last_update_check_error_(DRIVE_FILE_OK), | 305 last_update_check_error_(DRIVE_FILE_OK), |
| 306 hide_hosted_docs_(false), | 306 hide_hosted_docs_(false), |
| 307 blocking_task_runner_(blocking_task_runner), | 307 blocking_task_runner_(blocking_task_runner), |
| 308 scheduler_(new DriveScheduler(profile, &drive_operations_)), | 308 scheduler_(new DriveScheduler(profile, |
| 309 drive_service, |
| 310 &drive_operations_)), |
| 309 polling_interval_sec_(kFastPollingIntervalInSec), | 311 polling_interval_sec_(kFastPollingIntervalInSec), |
| 310 push_notification_enabled_(false), | 312 push_notification_enabled_(false), |
| 311 ALLOW_THIS_IN_INITIALIZER_LIST(ui_weak_ptr_factory_(this)), | 313 ALLOW_THIS_IN_INITIALIZER_LIST(ui_weak_ptr_factory_(this)), |
| 312 ui_weak_ptr_(ui_weak_ptr_factory_.GetWeakPtr()) { | 314 ui_weak_ptr_(ui_weak_ptr_factory_.GetWeakPtr()) { |
| 313 // Should be created from the file browser extension API on UI thread. | 315 // Should be created from the file browser extension API on UI thread. |
| 314 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 316 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 315 } | 317 } |
| 316 | 318 |
| 317 void DriveFileSystem::Reload() { | 319 void DriveFileSystem::Reload() { |
| 318 ResetResourceMetadata(); | 320 ResetResourceMetadata(); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 336 | 338 |
| 337 scheduler_->Initialize(); | 339 scheduler_->Initialize(); |
| 338 | 340 |
| 339 InitializePreferenceObserver(); | 341 InitializePreferenceObserver(); |
| 340 } | 342 } |
| 341 | 343 |
| 342 void DriveFileSystem::ResetResourceMetadata() { | 344 void DriveFileSystem::ResetResourceMetadata() { |
| 343 resource_metadata_.reset(new DriveResourceMetadata); | 345 resource_metadata_.reset(new DriveResourceMetadata); |
| 344 feed_loader_.reset(new DriveFeedLoader(resource_metadata_.get(), | 346 feed_loader_.reset(new DriveFeedLoader(resource_metadata_.get(), |
| 345 drive_service_, | 347 drive_service_, |
| 348 scheduler_.get(), |
| 346 webapps_registry_, | 349 webapps_registry_, |
| 347 cache_, | 350 cache_, |
| 348 blocking_task_runner_)); | 351 blocking_task_runner_)); |
| 349 feed_loader_->AddObserver(this); | 352 feed_loader_->AddObserver(this); |
| 350 | 353 |
| 351 // Allocate the drive operation handlers. | 354 // Allocate the drive operation handlers. |
| 352 drive_operations_.Init(drive_service_, | 355 drive_operations_.Init(drive_service_, |
| 353 this, // DriveFileSystemInterface | 356 this, // DriveFileSystemInterface |
| 354 cache_, | 357 cache_, |
| 355 resource_metadata_.get(), | 358 resource_metadata_.get(), |
| (...skipping 1870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2226 return; | 2229 return; |
| 2227 } | 2230 } |
| 2228 | 2231 |
| 2229 PlatformFileInfoProto entry_file_info; | 2232 PlatformFileInfoProto entry_file_info; |
| 2230 util::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); | 2233 util::ConvertPlatformFileInfoToProto(*file_info, &entry_file_info); |
| 2231 *entry_proto->mutable_file_info() = entry_file_info; | 2234 *entry_proto->mutable_file_info() = entry_file_info; |
| 2232 callback.Run(DRIVE_FILE_OK, entry_proto.Pass()); | 2235 callback.Run(DRIVE_FILE_OK, entry_proto.Pass()); |
| 2233 } | 2236 } |
| 2234 | 2237 |
| 2235 } // namespace drive | 2238 } // namespace drive |
| OLD | NEW |