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/file_system/touch_operation.h" | 5 #include "chrome/browser/chromeos/drive/file_system/touch_operation.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/sequenced_task_runner.h" | 9 #include "base/sequenced_task_runner.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "chrome/browser/chromeos/drive/file_change.h" |
11 #include "chrome/browser/chromeos/drive/file_errors.h" | 12 #include "chrome/browser/chromeos/drive/file_errors.h" |
12 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" | 13 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" |
13 #include "chrome/browser/chromeos/drive/resource_metadata.h" | 14 #include "chrome/browser/chromeos/drive/resource_metadata.h" |
14 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
15 | 16 |
16 using content::BrowserThread; | 17 using content::BrowserThread; |
17 | 18 |
18 namespace drive { | 19 namespace drive { |
19 namespace file_system { | 20 namespace file_system { |
20 | 21 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 82 } |
82 | 83 |
83 void TouchOperation::TouchFileAfterUpdateLocalState( | 84 void TouchOperation::TouchFileAfterUpdateLocalState( |
84 const base::FilePath& file_path, | 85 const base::FilePath& file_path, |
85 const FileOperationCallback& callback, | 86 const FileOperationCallback& callback, |
86 const std::string* local_id, | 87 const std::string* local_id, |
87 FileError error) { | 88 FileError error) { |
88 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 89 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
89 DCHECK(!callback.is_null()); | 90 DCHECK(!callback.is_null()); |
90 | 91 |
| 92 FileChange changed_files; |
| 93 changed_files.Update(file_path, |
| 94 FileChange::FILE_TYPE_FILE, |
| 95 FileChange::ADD_OR_UPDATE); |
| 96 |
91 if (error == FILE_ERROR_OK) { | 97 if (error == FILE_ERROR_OK) { |
92 observer_->OnDirectoryChangedByOperation(file_path.DirName()); | 98 observer_->OnDirectoryChangedByOperation(changed_files); |
93 observer_->OnEntryUpdatedByOperation(*local_id); | 99 observer_->OnEntryUpdatedByOperation(*local_id); |
94 } | 100 } |
95 callback.Run(error); | 101 callback.Run(error); |
96 } | 102 } |
97 | 103 |
98 } // namespace file_system | 104 } // namespace file_system |
99 } // namespace drive | 105 } // namespace drive |
OLD | NEW |