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 |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "chrome/browser/extensions/extension_function.h" | 13 #include "chrome/browser/extensions/extension_function.h" |
14 #include "chrome/browser/media_gallery/media_file_system_registry.h" | 14 #include "chrome/browser/media_gallery/media_file_system_registry.h" |
15 | 15 |
16 namespace extensions { | 16 namespace extensions { |
17 | 17 |
18 class MediaGalleriesGetMediaFileSystemsFunction | 18 class MediaGalleriesGetMediaFileSystemsFunction |
19 : public AsyncExtensionFunction { | 19 : public AsyncExtensionFunction { |
20 public: | 20 public: |
21 DECLARE_EXTENSION_FUNCTION_NAME("mediaGalleries.getMediaFileSystems") | 21 DECLARE_EXTENSION_FUNCTION_NAME("mediaGalleries.getMediaFileSystems") |
22 | 22 |
23 protected: | 23 protected: |
24 virtual ~MediaGalleriesGetMediaFileSystemsFunction(); | 24 virtual ~MediaGalleriesGetMediaFileSystemsFunction(); |
| 25 |
| 26 // ExtensionFunction:: override. |
| 27 virtual bool HasPermission() OVERRIDE; |
25 virtual bool RunImpl() OVERRIDE; | 28 virtual bool RunImpl() OVERRIDE; |
26 | 29 |
27 private: | 30 private: |
28 // If no galleries are found, show the dialog, otherwise return them. | 31 // If no galleries are found, show the dialog, otherwise return them. |
29 void ShowDialogIfNoGalleries( | 32 void ShowDialogIfNoGalleries( |
30 const std::vector<chrome::MediaFileSystemInfo>& filesystems); | 33 const std::vector<chrome::MediaFileSystemInfo>& filesystems); |
31 | 34 |
32 // Grabs galleries from the media file system registry and passes them to | 35 // Grabs galleries from the media file system registry and passes them to |
33 // |ReturnGalleries|. | 36 // |ReturnGalleries|. |
34 void GetAndReturnGalleries(); | 37 void GetAndReturnGalleries(); |
(...skipping 12 matching lines...) Expand all Loading... |
47 "experimental.mediaGalleries.assembleMediaFile") | 50 "experimental.mediaGalleries.assembleMediaFile") |
48 | 51 |
49 protected: | 52 protected: |
50 virtual ~MediaGalleriesAssembleMediaFileFunction(); | 53 virtual ~MediaGalleriesAssembleMediaFileFunction(); |
51 virtual bool RunImpl() OVERRIDE; | 54 virtual bool RunImpl() OVERRIDE; |
52 }; | 55 }; |
53 | 56 |
54 } // namespace extensions | 57 } // namespace extensions |
55 | 58 |
56 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ | 59 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ |
OLD | NEW |