| 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 "extensions/browser/api/system_storage/system_storage_api.h" | 5 #include "extensions/browser/api/system_storage/system_storage_api.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 | 8 |
| 9 using storage_monitor::StorageMonitor; | 9 using storage_monitor::StorageMonitor; |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 case StorageMonitor::EJECT_IN_USE: | 82 case StorageMonitor::EJECT_IN_USE: |
| 83 result = api::system_storage::EJECT_DEVICE_RESULT_CODE_IN_USE; | 83 result = api::system_storage::EJECT_DEVICE_RESULT_CODE_IN_USE; |
| 84 break; | 84 break; |
| 85 case StorageMonitor::EJECT_NO_SUCH_DEVICE: | 85 case StorageMonitor::EJECT_NO_SUCH_DEVICE: |
| 86 result = api::system_storage::EJECT_DEVICE_RESULT_CODE_NO_SUCH_DEVICE; | 86 result = api::system_storage::EJECT_DEVICE_RESULT_CODE_NO_SUCH_DEVICE; |
| 87 break; | 87 break; |
| 88 case StorageMonitor::EJECT_FAILURE: | 88 case StorageMonitor::EJECT_FAILURE: |
| 89 result = api::system_storage::EJECT_DEVICE_RESULT_CODE_FAILURE; | 89 result = api::system_storage::EJECT_DEVICE_RESULT_CODE_FAILURE; |
| 90 } | 90 } |
| 91 | 91 |
| 92 Respond(OneArgument(base::MakeUnique<base::StringValue>( | 92 Respond(OneArgument( |
| 93 api::system_storage::ToString(result)))); | 93 base::MakeUnique<base::Value>(api::system_storage::ToString(result)))); |
| 94 } | 94 } |
| 95 | 95 |
| 96 SystemStorageGetAvailableCapacityFunction:: | 96 SystemStorageGetAvailableCapacityFunction:: |
| 97 SystemStorageGetAvailableCapacityFunction() { | 97 SystemStorageGetAvailableCapacityFunction() { |
| 98 } | 98 } |
| 99 | 99 |
| 100 SystemStorageGetAvailableCapacityFunction:: | 100 SystemStorageGetAvailableCapacityFunction:: |
| 101 ~SystemStorageGetAvailableCapacityFunction() { | 101 ~SystemStorageGetAvailableCapacityFunction() { |
| 102 } | 102 } |
| 103 | 103 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 api::system_storage::StorageAvailableCapacityInfo result; | 138 api::system_storage::StorageAvailableCapacityInfo result; |
| 139 result.id = transient_id; | 139 result.id = transient_id; |
| 140 result.available_capacity = available_capacity; | 140 result.available_capacity = available_capacity; |
| 141 Respond(OneArgument(result.ToValue())); | 141 Respond(OneArgument(result.ToValue())); |
| 142 } else { | 142 } else { |
| 143 Respond(Error("Error occurred when querying available capacity.")); | 143 Respond(Error("Error occurred when querying available capacity.")); |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 | 146 |
| 147 } // namespace extensions | 147 } // namespace extensions |
| OLD | NEW |