OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/file_system_provider/operations/read_directory
.h" | 5 #include "chrome/browser/chromeos/file_system_provider/operations/read_directory
.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/memory/linked_ptr.h" | 9 #include "base/memory/linked_ptr.h" |
10 #include "chrome/common/extensions/api/file_system_provider.h" | 10 #include "chrome/common/extensions/api/file_system_provider.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 scoped_ptr<base::ListValue> values(new base::ListValue); | 69 scoped_ptr<base::ListValue> values(new base::ListValue); |
70 values->AppendString(directory_path_.AsUTF8Unsafe()); | 70 values->AppendString(directory_path_.AsUTF8Unsafe()); |
71 return SendEvent(request_id, | 71 return SendEvent(request_id, |
72 extensions::api::file_system_provider:: | 72 extensions::api::file_system_provider:: |
73 OnReadDirectoryRequested::kEventName, | 73 OnReadDirectoryRequested::kEventName, |
74 values.Pass()); | 74 values.Pass()); |
75 } | 75 } |
76 | 76 |
77 void ReadDirectory::OnSuccess(int /* request_id */, | 77 void ReadDirectory::OnSuccess(int /* request_id */, |
78 scoped_ptr<RequestValue> result, | 78 scoped_ptr<RequestValue> result, |
79 bool has_next) { | 79 bool has_more) { |
80 fileapi::AsyncFileUtil::EntryList entry_list; | 80 fileapi::AsyncFileUtil::EntryList entry_list; |
81 const bool convert_result = | 81 const bool convert_result = |
82 ConvertRequestValueToEntryList(result.Pass(), &entry_list); | 82 ConvertRequestValueToEntryList(result.Pass(), &entry_list); |
83 DCHECK(convert_result); | 83 DCHECK(convert_result); |
84 callback_.Run(base::File::FILE_OK, entry_list, has_next); | 84 callback_.Run(base::File::FILE_OK, entry_list, has_more); |
85 } | 85 } |
86 | 86 |
87 void ReadDirectory::OnError(int /* request_id */, base::File::Error error) { | 87 void ReadDirectory::OnError(int /* request_id */, base::File::Error error) { |
88 callback_.Run( | 88 callback_.Run( |
89 error, fileapi::AsyncFileUtil::EntryList(), false /* has_next */); | 89 error, fileapi::AsyncFileUtil::EntryList(), false /* has_more */); |
90 } | 90 } |
91 | 91 |
92 } // namespace operations | 92 } // namespace operations |
93 } // namespace file_system_provider | 93 } // namespace file_system_provider |
94 } // namespace chromeos | 94 } // namespace chromeos |
OLD | NEW |