Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/gdata/gdata_file_system_proxy.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_file_system_proxy.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/platform_file.h" | 11 #include "base/platform_file.h" |
| 12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
| 15 #include "chrome/browser/chromeos/gdata/gdata.pb.h" | 15 #include "chrome/browser/chromeos/gdata/gdata.pb.h" |
| 16 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" | |
| 16 #include "chrome/browser/chromeos/gdata/gdata_system_service.h" | 17 #include "chrome/browser/chromeos/gdata/gdata_system_service.h" |
| 17 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" | 18 #include "chrome/browser/chromeos/gdata/gdata_util.h" |
| 18 #include "webkit/blob/shareable_file_reference.h" | 19 #include "webkit/blob/shareable_file_reference.h" |
| 19 #include "webkit/fileapi/file_system_file_util_proxy.h" | 20 #include "webkit/fileapi/file_system_file_util_proxy.h" |
| 20 #include "webkit/fileapi/file_system_types.h" | 21 #include "webkit/fileapi/file_system_types.h" |
| 21 #include "webkit/fileapi/file_system_util.h" | 22 #include "webkit/fileapi/file_system_util.h" |
| 22 | 23 |
| 23 using base::MessageLoopProxy; | 24 using base::MessageLoopProxy; |
| 24 using content::BrowserThread; | 25 using content::BrowserThread; |
| 25 using fileapi::FileSystemOperationInterface; | 26 using fileapi::FileSystemOperationInterface; |
| 26 using webkit_blob::ShareableFileReference; | 27 using webkit_blob::ShareableFileReference; |
| 27 | 28 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 145 if (!ValidateUrl(file_url, &file_path)) { | 146 if (!ValidateUrl(file_url, &file_path)) { |
| 146 base::MessageLoopProxy::current()->PostTask( | 147 base::MessageLoopProxy::current()->PostTask( |
| 147 FROM_HERE, | 148 FROM_HERE, |
| 148 base::Bind(callback, | 149 base::Bind(callback, |
| 149 base::PLATFORM_FILE_ERROR_NOT_FOUND, | 150 base::PLATFORM_FILE_ERROR_NOT_FOUND, |
| 150 std::vector<base::FileUtilProxy::Entry>(), | 151 std::vector<base::FileUtilProxy::Entry>(), |
| 151 false)); | 152 false)); |
| 152 return; | 153 return; |
| 153 } | 154 } |
| 154 | 155 |
| 156 if (util::GetSearchPathStatus(file_path) == util::GDATA_SEARCH_PATH_QUERY) { | |
|
satorux1
2012/05/03 17:58:34
please add some comment about what we are doing he
tbarzic
2012/05/03 23:56:17
Done.
| |
| 157 file_system_->SearchContent( | |
| 158 file_path.BaseName().value(), | |
| 159 base::Bind(&GDataFileSystemProxy::OnReadDirectory, | |
| 160 this, | |
| 161 file_system_->hide_hosted_documents(), | |
| 162 callback)); | |
| 163 return; | |
| 164 } | |
| 165 | |
| 155 file_system_->ReadDirectoryByPathAsync( | 166 file_system_->ReadDirectoryByPathAsync( |
| 156 file_path, | 167 file_path, |
| 157 base::Bind(&GDataFileSystemProxy::OnReadDirectory, | 168 base::Bind(&GDataFileSystemProxy::OnReadDirectory, |
| 158 this, | 169 this, |
| 159 file_system_->hide_hosted_documents(), | 170 file_system_->hide_hosted_documents(), |
| 160 callback)); | 171 callback)); |
| 161 } | 172 } |
| 162 | 173 |
| 163 void GDataFileSystemProxy::Remove(const GURL& file_url, bool recursive, | 174 void GDataFileSystemProxy::Remove(const GURL& file_url, bool recursive, |
| 164 const FileSystemOperationInterface::StatusCallback& callback) { | 175 const FileSystemOperationInterface::StatusCallback& callback) { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 264 if (hide_hosted_documents && proto.is_hosted_document()) | 275 if (hide_hosted_documents && proto.is_hosted_document()) |
| 265 continue; | 276 continue; |
| 266 entries.push_back( | 277 entries.push_back( |
| 267 GDataEntryProtoToFileUtilProxyEntry(proto.gdata_entry())); | 278 GDataEntryProtoToFileUtilProxyEntry(proto.gdata_entry())); |
| 268 } | 279 } |
| 269 | 280 |
| 270 callback.Run(base::PLATFORM_FILE_OK, entries, false); | 281 callback.Run(base::PLATFORM_FILE_OK, entries, false); |
| 271 } | 282 } |
| 272 | 283 |
| 273 } // namespace gdata | 284 } // namespace gdata |
| OLD | NEW |