app_list: Re-enable people search.
[chromium-blink-merge.git] / chrome / browser / extensions / api / image_writer_private / removable_storage_provider.h
blobc0332a0c204a4df2fcc0eb48a3960910a7215c24
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
3 // found in the LICENSE file.
4 #ifndef CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_REMOVABLE_STORAGE_PROVIDER_H_
5 #define CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_REMOVABLE_STORAGE_PROVIDER_H_
7 #include "base/callback.h"
8 #include "chrome/common/extensions/api/image_writer_private.h"
9 #include "chrome/common/ref_counted_util.h"
11 namespace extensions {
13 // TODO(haven): Clean up this class to remove refcounting. http://crbug/370590
15 typedef RefCountedVector<linked_ptr
16 <api::image_writer_private::RemovableStorageDevice> > StorageDeviceList;
18 // Abstraction for platform specific implementations of listing removable
19 // storage devices
20 class RemovableStorageProvider {
21 public:
22 typedef base::Callback<void(scoped_refptr<StorageDeviceList>, bool)>
23 DeviceListReadyCallback;
25 // Gets the list of all available devices and returns it via callback.
26 static void GetAllDevices(DeviceListReadyCallback callback);
28 // Sets the list of devices that will be returned by GetAllDevices during
29 // testing. All calls to |GetAllDevices| will return this list until
30 // |ClearDeviceListForTesting| is called.
31 static void SetDeviceListForTesting(
32 scoped_refptr<StorageDeviceList> device_list);
33 // Clears the list of devices that is used during testing.
34 static void ClearDeviceListForTesting();
36 private:
37 // Fills the provided empty device list with the available devices.
38 static bool PopulateDeviceList(scoped_refptr<StorageDeviceList> device_list);
41 } // namespace extensions
43 #endif // CHROME_BROWSER_EXTENSIONS_API_IMAGE_WRITER_PRIVATE_REMOVABLE_STORAGE_PROVIDER_H_