Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6386)

Unified Diff: chrome/browser/extensions/api/media_galleries/media_galleries_api.h

Issue 93643002: Media Galleries: Add chrome.mediaGalleries.addUserSelectedFolder(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix selected folder name Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/extensions/api/media_galleries/media_galleries_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/media_galleries/media_galleries_api.h
===================================================================
--- chrome/browser/extensions/api/media_galleries/media_galleries_api.h (revision 243958)
+++ chrome/browser/extensions/api/media_galleries/media_galleries_api.h (working copy)
@@ -8,6 +8,7 @@
#ifndef CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_
+#include <string>
#include <vector>
#include "base/memory/scoped_ptr.h"
@@ -78,6 +79,39 @@
const MediaStorageUtil::DeviceIdSet* available_devices);
};
+class MediaGalleriesAddUserSelectedFolderFunction
+ : public ChromeAsyncExtensionFunction {
+ public:
+ DECLARE_EXTENSION_FUNCTION("mediaGalleries.addUserSelectedFolder",
+ MEDIAGALLERIES_ADDUSERSELECTEDFOLDER)
+
+ protected:
+ virtual ~MediaGalleriesAddUserSelectedFolderFunction();
+ virtual bool RunImpl() OVERRIDE;
+
+ private:
+ // Bottom half for RunImpl, invoked after the preferences is initialized.
+ void OnPreferencesInit();
+
+ // Callback for the directory prompt request, with the input from the user.
+ // If |selected_directory| is empty, then the user canceled.
+ // Either handle the user canceled case or add the selected gallery.
+ void OnDirectorySelected(const base::FilePath& selected_directory);
+
+ // Callback for the directory prompt request. |pref_id| is for the gallery
+ // the user just added. |filesystems| is the entire list of file systems.
+ // The fsid for the file system that corresponds to |pref_id| will be
+ // appended to the list of file systems returned to the caller. The
+ // Javascript binding for this API will interpret the list appropriately.
+ void ReturnGalleriesAndId(
+ MediaGalleryPrefId pref_id,
+ const std::vector<MediaFileSystemInfo>& filesystems);
+
+ // A helper method that calls
+ // MediaFileSystemRegistry::GetMediaFileSystemsForExtension().
+ void GetMediaFileSystemsForExtension(const MediaFileSystemsCallback& cb);
+};
+
class MediaGalleriesGetMetadataFunction : public ChromeAsyncExtensionFunction {
public:
DECLARE_EXTENSION_FUNCTION("mediaGalleries.getMetadata",
« no previous file with comments | « no previous file | chrome/browser/extensions/api/media_galleries/media_galleries_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698