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 #include "chrome/browser/chromeos/extensions/file_manager_util.h" | 4 #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
5 | 5 |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 return type_str; | 168 return type_str; |
169 } | 169 } |
170 | 170 |
171 DictionaryValue* ProgessStatusToDictionaryValue( | 171 DictionaryValue* ProgessStatusToDictionaryValue( |
172 Profile* profile, | 172 Profile* profile, |
173 const GURL& origin_url, | 173 const GURL& origin_url, |
174 const GDataOperationRegistry::ProgressStatus& status) { | 174 const GDataOperationRegistry::ProgressStatus& status) { |
175 scoped_ptr<DictionaryValue> result(new DictionaryValue()); | 175 scoped_ptr<DictionaryValue> result(new DictionaryValue()); |
176 GURL file_url; | 176 GURL file_url; |
177 if (file_manager_util::ConvertFileToFileSystemUrl(profile, | 177 if (file_manager_util::ConvertFileToFileSystemUrl(profile, |
178 FilePath(status.file_path), | 178 FilePath("/special").Append(FilePath(status.file_path)), |
179 origin_url, | 179 origin_url, |
180 &file_url)) { | 180 &file_url)) { |
181 result->SetString("fileUrl", file_url.spec()); | 181 result->SetString("fileUrl", file_url.spec()); |
182 } | 182 } |
183 | 183 |
184 result->SetString("transferState", | 184 result->SetString("transferState", |
185 GDataOperationRegistry::OperationTransferStateToString( | 185 GDataOperationRegistry::OperationTransferStateToString( |
186 status.transfer_state)); | 186 status.transfer_state)); |
187 result->SetString("transferType", | 187 result->SetString("transferType", |
188 GDataOperationRegistry::OperationTypeToString(status.operation_type)); | 188 GDataOperationRegistry::OperationTypeToString(status.operation_type)); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 GDataOperationRegistry::ProgressStatus>::const_iterator iter = | 530 GDataOperationRegistry::ProgressStatus>::const_iterator iter = |
531 list.begin(); | 531 list.begin(); |
532 iter != list.end(); ++iter) { | 532 iter != list.end(); ++iter) { |
533 result_list->Append( | 533 result_list->Append( |
534 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); | 534 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); |
535 } | 535 } |
536 return result_list.release(); | 536 return result_list.release(); |
537 } | 537 } |
538 | 538 |
539 } // namespace file_manager_util | 539 } // namespace file_manager_util |
OLD | NEW |