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

Unified Diff: chrome/browser/media_gallery/media_device_manager.h

Issue 10409084: Media Gallery: Implement a basic version of GetMediaFileSystems(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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
Index: chrome/browser/media_gallery/media_device_manager.h
===================================================================
--- chrome/browser/media_gallery/media_device_manager.h (revision 0)
+++ chrome/browser/media_gallery/media_device_manager.h (revision 0)
@@ -0,0 +1,61 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// MediaDeviceManager registers pictures directories as File API filesystems
+// and keeps track of the path to filesystem ID mappings.
+// In the near future, MediaDeviceManager will also support media devices.
+
+#ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_MANAGER_H_
+#define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_MANAGER_H_
+#pragma once
+
+#include <map>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/lazy_instance.h"
+
+class FilePath;
+
+namespace fileapi {
+class IsolatedContext;
+}
+
+namespace chrome {
+
+class MediaDeviceManager {
vandebo (ex-Chrome) 2012/05/23 00:50:46 nit: MediaFileSystemsManager / MediaFileSystemRegi
Lei Zhang 2012/05/23 03:12:49 Sure, MediaFileSystemRegistry it is.
+ public:
+ // (Filesystem ID, path)
+ typedef std::pair<std::string, FilePath> MediaFSIDAndPath;
+
+ // The instance is lazily created per browser process.
+ static MediaDeviceManager* GetInstance();
+
+ // Returns the list of media filesystem IDs and paths.
+ // Called on the UI thread.
+ std::vector<MediaFSIDAndPath>* GetMediaFileSystems();
vandebo (ex-Chrome) 2012/05/23 00:50:46 I think (you may want to check with others), that
Lei Zhang 2012/05/23 03:12:49 Done. I see a few other places that do this and ci
+
+ private:
+ friend struct base::DefaultLazyInstanceTraits<MediaDeviceManager>;
+
+ // Mapping of media directories to filesystem IDs.
+ typedef std::map<FilePath, std::string> MediaPathToFSIDMap;
+
+ // Obtain an instance of this class via GetInstance().
+ MediaDeviceManager();
+ virtual ~MediaDeviceManager();
+
+ // Registers a path as a media file system.
+ void RegisterPathAsFileSystem(const FilePath& path);
+
+ MediaPathToFSIDMap media_fs_map_;
+
+ DISALLOW_COPY_AND_ASSIGN(MediaDeviceManager);
+};
+
+} // namespace chrome
+
+#endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_MANAGER_H_
Property changes on: chrome/browser/media_gallery/media_device_manager.h
___________________________________________________________________
Added: svn:eol-style
+ LF

Powered by Google App Engine
This is Rietveld 408576698