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/extensions/api/developer_private/developer_private_api.
h" | 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api.
h" |
6 | 6 |
7 #include "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
8 #include "apps/app_restore_service.h" | 8 #include "apps/app_restore_service.h" |
9 #include "apps/app_window.h" | 9 #include "apps/app_window.h" |
10 #include "apps/app_window_registry.h" | 10 #include "apps/app_window_registry.h" |
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1179 target_path = target_path.Append(file_list[i].name); | 1179 target_path = target_path.Append(file_list[i].name); |
1180 | 1180 |
1181 context_->operation_runner()->CreateSnapshotFile( | 1181 context_->operation_runner()->CreateSnapshotFile( |
1182 url, | 1182 url, |
1183 base::Bind(&DeveloperPrivateLoadDirectoryFunction::SnapshotFileCallback, | 1183 base::Bind(&DeveloperPrivateLoadDirectoryFunction::SnapshotFileCallback, |
1184 this, | 1184 this, |
1185 target_path)); | 1185 target_path)); |
1186 | 1186 |
1187 } | 1187 } |
1188 | 1188 |
1189 // Directory copy operation released here. | 1189 if (!has_more) { |
1190 pending_copy_operations_count_--; | 1190 // Directory copy operation released here. |
| 1191 pending_copy_operations_count_--; |
1191 | 1192 |
1192 if (!pending_copy_operations_count_) { | 1193 if (!pending_copy_operations_count_) { |
1193 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 1194 content::BrowserThread::PostTask( |
1194 base::Bind(&DeveloperPrivateLoadDirectoryFunction::SendResponse, | 1195 content::BrowserThread::UI, FROM_HERE, |
1195 this, | 1196 base::Bind(&DeveloperPrivateLoadDirectoryFunction::SendResponse, |
1196 success_)); | 1197 this, |
| 1198 success_)); |
| 1199 } |
1197 } | 1200 } |
1198 } | 1201 } |
1199 | 1202 |
1200 void DeveloperPrivateLoadDirectoryFunction::SnapshotFileCallback( | 1203 void DeveloperPrivateLoadDirectoryFunction::SnapshotFileCallback( |
1201 const base::FilePath& target_path, | 1204 const base::FilePath& target_path, |
1202 base::File::Error result, | 1205 base::File::Error result, |
1203 const base::File::Info& file_info, | 1206 const base::File::Info& file_info, |
1204 const base::FilePath& src_path, | 1207 const base::FilePath& src_path, |
1205 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { | 1208 const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) { |
1206 if (result != base::File::FILE_OK) { | 1209 if (result != base::File::FILE_OK) { |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 } | 1358 } |
1356 | 1359 |
1357 error_ui_util::HandleOpenDevTools(dict); | 1360 error_ui_util::HandleOpenDevTools(dict); |
1358 | 1361 |
1359 return true; | 1362 return true; |
1360 } | 1363 } |
1361 | 1364 |
1362 } // namespace api | 1365 } // namespace api |
1363 | 1366 |
1364 } // namespace extensions | 1367 } // namespace extensions |
OLD | NEW |