OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/chromeos/gdata/find_entry_delegate.h" |
| 6 |
| 7 #include "chrome/browser/chromeos/gdata/gdata_files.h" |
| 8 |
| 9 namespace gdata { |
| 10 |
| 11 FindEntryDelegate::~FindEntryDelegate() { |
| 12 } |
| 13 |
| 14 ReadOnlyFindEntryDelegate::ReadOnlyFindEntryDelegate() : entry_(NULL) { |
| 15 } |
| 16 |
| 17 void ReadOnlyFindEntryDelegate::OnDone(base::PlatformFileError error, |
| 18 const FilePath& directory_path, |
| 19 GDataEntry* entry) { |
| 20 DCHECK(!entry_); |
| 21 if (error == base::PLATFORM_FILE_OK) |
| 22 entry_ = entry; |
| 23 else |
| 24 entry_ = NULL; |
| 25 } |
| 26 |
| 27 FindEntryCallbackRelayDelegate::FindEntryCallbackRelayDelegate( |
| 28 const FindEntryCallback& callback) : callback_(callback) { |
| 29 } |
| 30 |
| 31 FindEntryCallbackRelayDelegate::~FindEntryCallbackRelayDelegate() { |
| 32 } |
| 33 |
| 34 void FindEntryCallbackRelayDelegate::OnDone(base::PlatformFileError error, |
| 35 const FilePath& directory_path, |
| 36 GDataEntry* entry) { |
| 37 if (!callback_.is_null()) { |
| 38 callback_.Run(error, directory_path, entry); |
| 39 } |
| 40 } |
| 41 |
| 42 } // namespace gdata |
OLD | NEW |