OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/sync/entry_update_performer.h" | 5 #include "chrome/browser/chromeos/drive/sync/entry_update_performer.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "chrome/browser/chromeos/drive/change_list_loader.h" | 9 #include "chrome/browser/chromeos/drive/change_list_loader.h" |
10 #include "chrome/browser/chromeos/drive/drive.pb.h" | 10 #include "chrome/browser/chromeos/drive/drive.pb.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 weak_ptr_factory_.GetWeakPtr(), | 351 weak_ptr_factory_.GetWeakPtr(), |
352 context, callback, local_state->entry.local_id(), | 352 context, callback, local_state->entry.local_id(), |
353 base::Passed(scoped_ptr<base::ScopedClosureRunner>()))); | 353 base::Passed(scoped_ptr<base::ScopedClosureRunner>()))); |
354 } | 354 } |
355 | 355 |
356 void EntryUpdatePerformer::UpdateEntryAfterUpdateResource( | 356 void EntryUpdatePerformer::UpdateEntryAfterUpdateResource( |
357 const ClientContext& context, | 357 const ClientContext& context, |
358 const FileOperationCallback& callback, | 358 const FileOperationCallback& callback, |
359 const std::string& local_id, | 359 const std::string& local_id, |
360 scoped_ptr<base::ScopedClosureRunner> loader_lock, | 360 scoped_ptr<base::ScopedClosureRunner> loader_lock, |
361 google_apis::GDataErrorCode status, | 361 google_apis::DriveApiErrorCode status, |
362 scoped_ptr<google_apis::FileResource> entry) { | 362 scoped_ptr<google_apis::FileResource> entry) { |
363 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 363 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
364 DCHECK(!callback.is_null()); | 364 DCHECK(!callback.is_null()); |
365 | 365 |
366 if (status == google_apis::HTTP_FORBIDDEN) { | 366 if (status == google_apis::HTTP_FORBIDDEN) { |
367 // Editing this entry is not allowed, revert local changes. | 367 // Editing this entry is not allowed, revert local changes. |
368 entry_revert_performer_->RevertEntry(local_id, context, callback); | 368 entry_revert_performer_->RevertEntry(local_id, context, callback); |
369 return; | 369 return; |
370 } | 370 } |
371 | 371 |
(...skipping 25 matching lines...) Expand all Loading... |
397 FileError error) { | 397 FileError error) { |
398 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 398 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
399 DCHECK(!callback.is_null()); | 399 DCHECK(!callback.is_null()); |
400 | 400 |
401 delegate_->OnFileChangedByOperation(*changed_files); | 401 delegate_->OnFileChangedByOperation(*changed_files); |
402 callback.Run(error); | 402 callback.Run(error); |
403 } | 403 } |
404 | 404 |
405 } // namespace internal | 405 } // namespace internal |
406 } // namespace drive | 406 } // namespace drive |
OLD | NEW |