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 <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/callback_forward.h" | 14 #include "base/callback_forward.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "chrome/browser/extensions/chrome_extension_function.h" | 17 #include "chrome/browser/extensions/chrome_extension_function.h" |
18 #include "chrome/browser/media_galleries/media_file_system_registry.h" | 18 #include "chrome/browser/media_galleries/media_file_system_registry.h" |
19 #include "chrome/browser/media_galleries/media_scan_manager_observer.h" | 19 #include "chrome/browser/media_galleries/media_scan_manager_observer.h" |
20 #include "chrome/common/extensions/api/media_galleries.h" | 20 #include "chrome/common/extensions/api/media_galleries.h" |
21 #include "chrome/common/media_galleries/metadata_types.h" | 21 #include "chrome/common/media_galleries/metadata_types.h" |
22 #include "components/storage_monitor/media_storage_util.h" | 22 #include "components/storage_monitor/media_storage_util.h" |
23 #include "extensions/browser/browser_context_keyed_api_factory.h" | 23 #include "extensions/browser/browser_context_keyed_api_factory.h" |
24 | 24 |
25 namespace MediaGalleries = extensions::api::media_galleries; | 25 namespace MediaGalleries = extensions::api::media_galleries; |
26 | 26 |
27 class MediaGalleriesScanResultDialogController; | 27 class MediaGalleriesScanResultController; |
28 | 28 |
29 namespace content { | 29 namespace content { |
30 class BlobHandle; | 30 class BlobHandle; |
31 class WebContents; | 31 class WebContents; |
32 } | 32 } |
33 | 33 |
34 namespace metadata { | 34 namespace metadata { |
35 class SafeMediaMetadataParser; | 35 class SafeMediaMetadataParser; |
36 } | 36 } |
37 | 37 |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 : public ChromeAsyncExtensionFunction { | 230 : public ChromeAsyncExtensionFunction { |
231 public: | 231 public: |
232 DECLARE_EXTENSION_FUNCTION("mediaGalleries.addScanResults", | 232 DECLARE_EXTENSION_FUNCTION("mediaGalleries.addScanResults", |
233 MEDIAGALLERIES_ADDSCANRESULTS) | 233 MEDIAGALLERIES_ADDSCANRESULTS) |
234 | 234 |
235 protected: | 235 protected: |
236 virtual ~MediaGalleriesAddScanResultsFunction(); | 236 virtual ~MediaGalleriesAddScanResultsFunction(); |
237 virtual bool RunAsync() OVERRIDE; | 237 virtual bool RunAsync() OVERRIDE; |
238 | 238 |
239 // Pulled out for testing. | 239 // Pulled out for testing. |
240 virtual MediaGalleriesScanResultDialogController* MakeDialog( | 240 virtual MediaGalleriesScanResultController* MakeDialog( |
241 content::WebContents* web_contents, | 241 content::WebContents* web_contents, |
242 const extensions::Extension& extension, | 242 const extensions::Extension& extension, |
243 const base::Closure& on_finish); | 243 const base::Closure& on_finish); |
244 | 244 |
245 private: | 245 private: |
246 // Bottom half for RunAsync, invoked after the preferences is initialized. | 246 // Bottom half for RunAsync, invoked after the preferences is initialized. |
247 void OnPreferencesInit(); | 247 void OnPreferencesInit(); |
248 | 248 |
249 // Grabs galleries from the media file system registry and passes them to | 249 // Grabs galleries from the media file system registry and passes them to |
250 // ReturnGalleries(). | 250 // ReturnGalleries(). |
(...skipping 29 matching lines...) Expand all Loading... |
280 void ConstructNextBlob( | 280 void ConstructNextBlob( |
281 scoped_ptr<base::DictionaryValue> result_dictionary, | 281 scoped_ptr<base::DictionaryValue> result_dictionary, |
282 scoped_ptr<std::vector<metadata::AttachedImage> > attached_images, | 282 scoped_ptr<std::vector<metadata::AttachedImage> > attached_images, |
283 scoped_ptr<std::vector<std::string> > blob_uuids, | 283 scoped_ptr<std::vector<std::string> > blob_uuids, |
284 scoped_ptr<content::BlobHandle> current_blob); | 284 scoped_ptr<content::BlobHandle> current_blob); |
285 }; | 285 }; |
286 | 286 |
287 } // namespace extensions | 287 } // namespace extensions |
288 | 288 |
289 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ | 289 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ |
OLD | NEW |