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

Side by Side Diff: chrome/browser/extensions/api/media_galleries/media_galleries_api.h

Issue 14556015: [Media Galleries] Lazily initialize the storage monitor. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix merge Created 7 years, 6 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 unified diff | Download patch
OLDNEW
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_galleries/media_file_system_registry.h" 14 #include "chrome/browser/media_galleries/media_file_system_registry.h"
15 #include "chrome/common/extensions/api/media_galleries.h"
16
17 namespace MediaGalleries = extensions::api::media_galleries;
15 18
16 namespace extensions { 19 namespace extensions {
17 20
18 class MediaGalleriesGetMediaFileSystemsFunction 21 class MediaGalleriesGetMediaFileSystemsFunction
19 : public AsyncExtensionFunction { 22 : public AsyncExtensionFunction {
20 public: 23 public:
21 DECLARE_EXTENSION_FUNCTION("mediaGalleries.getMediaFileSystems", 24 DECLARE_EXTENSION_FUNCTION("mediaGalleries.getMediaFileSystems",
22 MEDIAGALLERIES_GETMEDIAFILESYSTEMS) 25 MEDIAGALLERIES_GETMEDIAFILESYSTEMS)
23 26
24 protected: 27 protected:
25 virtual ~MediaGalleriesGetMediaFileSystemsFunction(); 28 virtual ~MediaGalleriesGetMediaFileSystemsFunction();
26 virtual bool RunImpl() OVERRIDE; 29 virtual bool RunImpl() OVERRIDE;
27 30
28 private: 31 private:
32 // Bottom half for RunImpl, invoked after the storage monitor is initialized.
33 void OnStorageMonitorInit(
34 MediaGalleries::GetMediaFileSystemsInteractivity interactive);
35
29 // Always show the dialog. 36 // Always show the dialog.
30 void AlwaysShowDialog( 37 void AlwaysShowDialog(
31 const std::vector<chrome::MediaFileSystemInfo>& filesystems); 38 const std::vector<chrome::MediaFileSystemInfo>& filesystems);
32 39
33 // If no galleries are found, show the dialog, otherwise return them. 40 // If no galleries are found, show the dialog, otherwise return them.
34 void ShowDialogIfNoGalleries( 41 void ShowDialogIfNoGalleries(
35 const std::vector<chrome::MediaFileSystemInfo>& filesystems); 42 const std::vector<chrome::MediaFileSystemInfo>& filesystems);
36 43
37 // Grabs galleries from the media file system registry and passes them to 44 // Grabs galleries from the media file system registry and passes them to
38 // |ReturnGalleries|. 45 // |ReturnGalleries|.
(...skipping 19 matching lines...) Expand all
58 EXPERIMENTAL_MEDIAGALLERIES_ASSEMBLEMEDIAFILE) 65 EXPERIMENTAL_MEDIAGALLERIES_ASSEMBLEMEDIAFILE)
59 66
60 protected: 67 protected:
61 virtual ~MediaGalleriesAssembleMediaFileFunction(); 68 virtual ~MediaGalleriesAssembleMediaFileFunction();
62 virtual bool RunImpl() OVERRIDE; 69 virtual bool RunImpl() OVERRIDE;
63 }; 70 };
64 71
65 } // namespace extensions 72 } // namespace extensions
66 73
67 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ 74 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698