| 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/media_galleries_private/media_galleries_
private_api.h" | 5 #include "chrome/browser/extensions/api/media_galleries_private/media_galleries_
private_api.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 using extensions::api::media_galleries_private::EjectDeviceResultCode; | 407 using extensions::api::media_galleries_private::EjectDeviceResultCode; |
| 408 | 408 |
| 409 EjectDeviceResultCode result = EJECT_DEVICE_RESULT_CODE_FAILURE; | 409 EjectDeviceResultCode result = EJECT_DEVICE_RESULT_CODE_FAILURE; |
| 410 if (status == chrome::StorageMonitor::EJECT_OK) | 410 if (status == chrome::StorageMonitor::EJECT_OK) |
| 411 result = EJECT_DEVICE_RESULT_CODE_SUCCESS; | 411 result = EJECT_DEVICE_RESULT_CODE_SUCCESS; |
| 412 if (status == chrome::StorageMonitor::EJECT_IN_USE) | 412 if (status == chrome::StorageMonitor::EJECT_IN_USE) |
| 413 result = EJECT_DEVICE_RESULT_CODE_IN_USE; | 413 result = EJECT_DEVICE_RESULT_CODE_IN_USE; |
| 414 if (status == chrome::StorageMonitor::EJECT_NO_SUCH_DEVICE) | 414 if (status == chrome::StorageMonitor::EJECT_NO_SUCH_DEVICE) |
| 415 result = EJECT_DEVICE_RESULT_CODE_NO_SUCH_DEVICE; | 415 result = EJECT_DEVICE_RESULT_CODE_NO_SUCH_DEVICE; |
| 416 | 416 |
| 417 SetResult(base::StringValue::CreateStringValue( | 417 SetResult(new base::StringValue( |
| 418 api::media_galleries_private::ToString(result))); | 418 api::media_galleries_private::ToString(result))); |
| 419 SendResponse(true); | 419 SendResponse(true); |
| 420 } | 420 } |
| 421 | 421 |
| 422 /////////////////////////////////////////////////////////////////////////////// | 422 /////////////////////////////////////////////////////////////////////////////// |
| 423 // MediaGalleriesPrivateGetHandlersFunction // | 423 // MediaGalleriesPrivateGetHandlersFunction // |
| 424 /////////////////////////////////////////////////////////////////////////////// | 424 /////////////////////////////////////////////////////////////////////////////// |
| 425 | 425 |
| 426 MediaGalleriesPrivateGetHandlersFunction:: | 426 MediaGalleriesPrivateGetHandlersFunction:: |
| 427 ~MediaGalleriesPrivateGetHandlersFunction() { | 427 ~MediaGalleriesPrivateGetHandlersFunction() { |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 } | 463 } |
| 464 } | 464 } |
| 465 | 465 |
| 466 SetResult(result_list); | 466 SetResult(result_list); |
| 467 SendResponse(true); | 467 SendResponse(true); |
| 468 | 468 |
| 469 return true; | 469 return true; |
| 470 } | 470 } |
| 471 | 471 |
| 472 } // namespace extensions | 472 } // namespace extensions |
| OLD | NEW |