| 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_dialog.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" | 7 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" |
| 8 #include "chrome/browser/ui/views/select_file_dialog_extension.h" | 8 #include "chrome/browser/ui/views/select_file_dialog_extension.h" |
| 9 #include "chrome/common/extensions/api/file_manager_private.h" | 9 #include "chrome/common/extensions/api/file_manager_private.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 base::Bind( | 56 base::Bind( |
| 57 &FileManagerPrivateSelectFileFunction::GetSelectedFileInfoResponse, | 57 &FileManagerPrivateSelectFileFunction::GetSelectedFileInfoResponse, |
| 58 this, | 58 this, |
| 59 params->index)); | 59 params->index)); |
| 60 return true; | 60 return true; |
| 61 } | 61 } |
| 62 | 62 |
| 63 void FileManagerPrivateSelectFileFunction::GetSelectedFileInfoResponse( | 63 void FileManagerPrivateSelectFileFunction::GetSelectedFileInfoResponse( |
| 64 int index, | 64 int index, |
| 65 const std::vector<ui::SelectedFileInfo>& files) { | 65 const std::vector<ui::SelectedFileInfo>& files) { |
| 66 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 66 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 67 if (files.size() != 1) { | 67 if (files.size() != 1) { |
| 68 SendResponse(false); | 68 SendResponse(false); |
| 69 return; | 69 return; |
| 70 } | 70 } |
| 71 SelectFileDialogExtension::OnFileSelected(GetFileDialogRoutingID(this), | 71 SelectFileDialogExtension::OnFileSelected(GetFileDialogRoutingID(this), |
| 72 files[0], index); | 72 files[0], index); |
| 73 SendResponse(true); | 73 SendResponse(true); |
| 74 } | 74 } |
| 75 | 75 |
| 76 bool FileManagerPrivateSelectFilesFunction::RunAsync() { | 76 bool FileManagerPrivateSelectFilesFunction::RunAsync() { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 90 file_manager::util::NEED_LOCAL_PATH_FOR_OPENING : | 90 file_manager::util::NEED_LOCAL_PATH_FOR_OPENING : |
| 91 file_manager::util::NO_LOCAL_PATH_RESOLUTION, | 91 file_manager::util::NO_LOCAL_PATH_RESOLUTION, |
| 92 base::Bind( | 92 base::Bind( |
| 93 &FileManagerPrivateSelectFilesFunction::GetSelectedFileInfoResponse, | 93 &FileManagerPrivateSelectFilesFunction::GetSelectedFileInfoResponse, |
| 94 this)); | 94 this)); |
| 95 return true; | 95 return true; |
| 96 } | 96 } |
| 97 | 97 |
| 98 void FileManagerPrivateSelectFilesFunction::GetSelectedFileInfoResponse( | 98 void FileManagerPrivateSelectFilesFunction::GetSelectedFileInfoResponse( |
| 99 const std::vector<ui::SelectedFileInfo>& files) { | 99 const std::vector<ui::SelectedFileInfo>& files) { |
| 100 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 100 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 101 if (files.empty()) { | 101 if (files.empty()) { |
| 102 SendResponse(false); | 102 SendResponse(false); |
| 103 return; | 103 return; |
| 104 } | 104 } |
| 105 | 105 |
| 106 SelectFileDialogExtension::OnMultiFilesSelected(GetFileDialogRoutingID(this), | 106 SelectFileDialogExtension::OnMultiFilesSelected(GetFileDialogRoutingID(this), |
| 107 files); | 107 files); |
| 108 SendResponse(true); | 108 SendResponse(true); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace extensions | 111 } // namespace extensions |
| OLD | NEW |