| 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_util.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 params->selected_files.push_back( | 141 params->selected_files.push_back( |
| 142 ui::SelectedFileInfo(file_path, base::FilePath())); | 142 ui::SelectedFileInfo(file_path, base::FilePath())); |
| 143 } | 143 } |
| 144 params->callback.Run(params->selected_files); | 144 params->callback.Run(params->selected_files); |
| 145 } | 145 } |
| 146 | 146 |
| 147 // Part of GetSelectedFileInfo(). | 147 // Part of GetSelectedFileInfo(). |
| 148 void ContinueGetSelectedFileInfo(Profile* profile, | 148 void ContinueGetSelectedFileInfo(Profile* profile, |
| 149 scoped_ptr<GetSelectedFileInfoParams> params, | 149 scoped_ptr<GetSelectedFileInfoParams> params, |
| 150 const base::FilePath& local_path) { | 150 const base::FilePath& local_path) { |
| 151 if (local_path.empty()) { |
| 152 params->callback.Run(std::vector<ui::SelectedFileInfo>()); |
| 153 return; |
| 154 } |
| 151 const int index = params->selected_files.size(); | 155 const int index = params->selected_files.size(); |
| 152 const base::FilePath& file_path = params->file_paths[index]; | 156 const base::FilePath& file_path = params->file_paths[index]; |
| 153 params->selected_files.push_back(ui::SelectedFileInfo(file_path, local_path)); | 157 params->selected_files.push_back(ui::SelectedFileInfo(file_path, local_path)); |
| 154 GetSelectedFileInfoInternal(profile, params.Pass()); | 158 GetSelectedFileInfoInternal(profile, params.Pass()); |
| 155 } | 159 } |
| 156 | 160 |
| 157 } // namespace | 161 } // namespace |
| 158 | 162 |
| 159 void VolumeInfoToVolumeMetadata( | 163 void VolumeInfoToVolumeMetadata( |
| 160 Profile* profile, | 164 Profile* profile, |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 } | 330 } |
| 327 | 331 |
| 328 drive::EventLogger* GetLogger(Profile* profile) { | 332 drive::EventLogger* GetLogger(Profile* profile) { |
| 329 drive::DriveIntegrationService* service = | 333 drive::DriveIntegrationService* service = |
| 330 drive::DriveIntegrationServiceFactory::FindForProfile(profile); | 334 drive::DriveIntegrationServiceFactory::FindForProfile(profile); |
| 331 return service ? service->event_logger() : NULL; | 335 return service ? service->event_logger() : NULL; |
| 332 } | 336 } |
| 333 | 337 |
| 334 } // namespace util | 338 } // namespace util |
| 335 } // namespace file_manager | 339 } // namespace file_manager |
| OLD | NEW |