Chromium Code Reviews| Index: chrome/browser/chromeos/drive/drive_scheduler.cc |
| diff --git a/chrome/browser/chromeos/drive/drive_scheduler.cc b/chrome/browser/chromeos/drive/drive_scheduler.cc |
| index 9b5b5b35257e522136f1a236b9e1ec48dbbe84f8..e41b27806181c702aad7210e96608eaddf57ee95 100644 |
| --- a/chrome/browser/chromeos/drive/drive_scheduler.cc |
| +++ b/chrome/browser/chromeos/drive/drive_scheduler.cc |
| @@ -30,15 +30,6 @@ const int DriveScheduler::kMaxJobCount[] = { |
| 1, // FILE_QUEUE |
| }; |
| -DriveScheduler::JobInfo::JobInfo(JobType in_job_type) |
| - : job_type(in_job_type), |
| - job_id(-1), |
| - completed_bytes(0), |
| - total_bytes(0), |
| - state(STATE_NONE) { |
| - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| -} |
| - |
| DriveScheduler::QueueEntry::QueueEntry() |
| : job_id(-1), |
| context(DriveClientContext(USER_INITIATED)) { |
| @@ -101,13 +92,21 @@ void DriveScheduler::Initialize() { |
| initialized_ = true; |
| } |
| -std::vector<DriveScheduler::JobInfo> DriveScheduler::GetJobInfoList() { |
| +std::vector<JobInfo> DriveScheduler::GetJobInfoList() { |
| std::vector<JobInfo> job_info_list; |
| for (JobIDMap::iterator iter(&job_map_); !iter.IsAtEnd(); iter.Advance()) |
| job_info_list.push_back(*iter.GetCurrentValue()); |
| return job_info_list; |
| } |
| +void DriveScheduler::AddObserver(DriveJobListObserver* observer) { |
| + observer_list_.AddObserver(observer); |
| +} |
| + |
| +void DriveScheduler::RemoveObserver(DriveJobListObserver* observer) { |
| + observer_list_.RemoveObserver(observer); |
| +} |
| + |
| void DriveScheduler::GetAccountMetadata( |
| const google_apis::GetAccountMetadataCallback& callback) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| @@ -903,4 +902,19 @@ DriveScheduler::QueueType DriveScheduler::GetJobQueueType(JobType type) { |
| return FILE_QUEUE; |
| } |
| +void DriveScheduler::NotifyJobAdded(const JobInfo& job_info) { |
| + FOR_EACH_OBSERVER(DriveJobListObserver, observer_list_, |
| + OnJobAdded(job_info)); |
| +} |
| + |
| +void DriveScheduler::NotifyJobDone(const JobInfo& job_info) { |
| + FOR_EACH_OBSERVER(DriveJobListObserver, observer_list_, |
| + OnJobDone(job_info)); |
| +} |
| + |
| +void DriveScheduler::NotifyJobUpdated(const JobInfo& job_info) { |
| + FOR_EACH_OBSERVER(DriveJobListObserver, observer_list_, |
| + OnJobUpdated(job_info)); |
|
satorux1
2013/04/17 00:11:29
These are not used in this patch. Intentional?
kinaba
2013/04/17 00:51:42
Intentional (especially for NotifyJobUpdated, not
|
| +} |
| + |
| } // namespace drive |