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/extensions/file_manager/private_api_file_syste
m.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_file_syste
m.h" |
6 | 6 |
7 #include <sys/stat.h> | 7 #include <sys/stat.h> |
8 #include <sys/statvfs.h> | 8 #include <sys/statvfs.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include <utime.h> | 10 #include <utime.h> |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 } | 182 } |
183 | 183 |
184 FileBrowserPrivateRequestFileSystemFunction:: | 184 FileBrowserPrivateRequestFileSystemFunction:: |
185 ~FileBrowserPrivateRequestFileSystemFunction() { | 185 ~FileBrowserPrivateRequestFileSystemFunction() { |
186 } | 186 } |
187 | 187 |
188 void FileBrowserPrivateRequestFileSystemFunction::DidOpenFileSystem( | 188 void FileBrowserPrivateRequestFileSystemFunction::DidOpenFileSystem( |
189 scoped_refptr<fileapi::FileSystemContext> file_system_context, | 189 scoped_refptr<fileapi::FileSystemContext> file_system_context, |
190 base::PlatformFileError result, | 190 base::PlatformFileError result, |
191 const std::string& name, | 191 const std::string& name, |
192 const GURL& root_path) { | 192 const GURL& root_url) { |
193 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 193 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
194 | 194 |
195 if (result != base::PLATFORM_FILE_OK) { | 195 if (result != base::PLATFORM_FILE_OK) { |
196 DidFail(result); | 196 DidFail(result); |
197 return; | 197 return; |
198 } | 198 } |
199 | 199 |
200 // RenderViewHost may have gone while the task is posted asynchronously. | 200 // RenderViewHost may have gone while the task is posted asynchronously. |
201 if (!render_view_host()) { | 201 if (!render_view_host()) { |
202 DidFail(base::PLATFORM_FILE_ERROR_FAILED); | 202 DidFail(base::PLATFORM_FILE_ERROR_FAILED); |
(...skipping 14 matching lines...) Expand all Loading... |
217 // UI only when we perform proper authentication. | 217 // UI only when we perform proper authentication. |
218 // | 218 // |
219 // Note that we call this function even when Drive is disabled by the | 219 // Note that we call this function even when Drive is disabled by the |
220 // setting. Otherwise, we need to call this when the setting is changed at | 220 // setting. Otherwise, we need to call this when the setting is changed at |
221 // a later time, which complicates the code. | 221 // a later time, which complicates the code. |
222 SetDriveMountPointPermissions(profile_, extension_id(), render_view_host()); | 222 SetDriveMountPointPermissions(profile_, extension_id(), render_view_host()); |
223 | 223 |
224 DictionaryValue* dict = new DictionaryValue(); | 224 DictionaryValue* dict = new DictionaryValue(); |
225 SetResult(dict); | 225 SetResult(dict); |
226 dict->SetString("name", name); | 226 dict->SetString("name", name); |
227 dict->SetString("path", root_path.spec()); | 227 dict->SetString("root_url", root_url.spec()); |
228 dict->SetInteger("error", drive::FILE_ERROR_OK); | 228 dict->SetInteger("error", drive::FILE_ERROR_OK); |
229 SendResponse(true); | 229 SendResponse(true); |
230 } | 230 } |
231 | 231 |
232 void FileBrowserPrivateRequestFileSystemFunction::DidFail( | 232 void FileBrowserPrivateRequestFileSystemFunction::DidFail( |
233 base::PlatformFileError error_code) { | 233 base::PlatformFileError error_code) { |
234 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 234 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
235 | 235 |
236 error_ = base::StringPrintf(kFileError, static_cast<int>(error_code)); | 236 error_ = base::StringPrintf(kFileError, static_cast<int>(error_code)); |
237 SendResponse(false); | 237 SendResponse(false); |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 FileBrowserPrivateCancelCopyFunction::~FileBrowserPrivateCancelCopyFunction() { | 642 FileBrowserPrivateCancelCopyFunction::~FileBrowserPrivateCancelCopyFunction() { |
643 } | 643 } |
644 | 644 |
645 bool FileBrowserPrivateCancelCopyFunction::RunImpl() { | 645 bool FileBrowserPrivateCancelCopyFunction::RunImpl() { |
646 // TODO(hidehiko): Implement cancelCopy function. | 646 // TODO(hidehiko): Implement cancelCopy function. |
647 NOTIMPLEMENTED(); | 647 NOTIMPLEMENTED(); |
648 return false; | 648 return false; |
649 } | 649 } |
650 | 650 |
651 } // namespace extensions | 651 } // namespace extensions |
OLD | NEW |