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 // Defines the Chrome Extensions Media Galleries API functions for accessing | 5 // Defines the Chrome Extensions Media Galleries API functions for accessing |
6 // user's media files, as specified in the extension API IDL. | 6 // user's media files, as specified in the extension API IDL. |
7 | 7 |
8 #ifndef CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ | 8 #ifndef CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ |
9 #define CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ | 9 #define CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 : public AsyncExtensionFunction { | 22 : public AsyncExtensionFunction { |
23 public: | 23 public: |
24 DECLARE_EXTENSION_FUNCTION("mediaGalleries.getMediaFileSystems", | 24 DECLARE_EXTENSION_FUNCTION("mediaGalleries.getMediaFileSystems", |
25 MEDIAGALLERIES_GETMEDIAFILESYSTEMS) | 25 MEDIAGALLERIES_GETMEDIAFILESYSTEMS) |
26 | 26 |
27 protected: | 27 protected: |
28 virtual ~MediaGalleriesGetMediaFileSystemsFunction(); | 28 virtual ~MediaGalleriesGetMediaFileSystemsFunction(); |
29 virtual bool RunImpl() OVERRIDE; | 29 virtual bool RunImpl() OVERRIDE; |
30 | 30 |
31 private: | 31 private: |
32 // Bottom half for RunImpl, invoked after the storage monitor is initialized. | 32 // Bottom half for RunImpl, invoked after the preferences is initialized. |
33 void OnStorageMonitorInit( | 33 void OnPreferencesInit( |
34 MediaGalleries::GetMediaFileSystemsInteractivity interactive); | 34 MediaGalleries::GetMediaFileSystemsInteractivity interactive); |
35 | 35 |
36 // Always show the dialog. | 36 // Always show the dialog. |
37 void AlwaysShowDialog(const std::vector<MediaFileSystemInfo>& filesystems); | 37 void AlwaysShowDialog(const std::vector<MediaFileSystemInfo>& filesystems); |
38 | 38 |
39 // If no galleries are found, show the dialog, otherwise return them. | 39 // If no galleries are found, show the dialog, otherwise return them. |
40 void ShowDialogIfNoGalleries( | 40 void ShowDialogIfNoGalleries( |
41 const std::vector<MediaFileSystemInfo>& filesystems); | 41 const std::vector<MediaFileSystemInfo>& filesystems); |
42 | 42 |
43 // Grabs galleries from the media file system registry and passes them to | 43 // Grabs galleries from the media file system registry and passes them to |
44 // |ReturnGalleries|. | 44 // |ReturnGalleries|. |
45 void GetAndReturnGalleries(); | 45 void GetAndReturnGalleries(); |
46 | 46 |
47 // Returns galleries to the caller. | 47 // Returns galleries to the caller. |
48 void ReturnGalleries(const std::vector<MediaFileSystemInfo>& filesystems); | 48 void ReturnGalleries(const std::vector<MediaFileSystemInfo>& filesystems); |
49 | 49 |
50 // Shows the configuration dialog to edit gallery preferences. | 50 // Shows the configuration dialog to edit gallery preferences. |
51 void ShowDialog(); | 51 void ShowDialog(); |
52 | 52 |
53 // A helper method that calls | 53 // A helper method that calls |
54 // MediaFileSystemRegistry::GetMediaFileSystemsForExtension(). | 54 // MediaFileSystemRegistry::GetMediaFileSystemsForExtension(). |
55 void GetMediaFileSystemsForExtension(const MediaFileSystemsCallback& cb); | 55 void GetMediaFileSystemsForExtension(const MediaFileSystemsCallback& cb); |
56 }; | 56 }; |
57 | 57 |
58 } // namespace extensions | 58 } // namespace extensions |
59 | 59 |
60 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ | 60 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ |
OLD | NEW |