| 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/gallery_watch_manager_observer.h" | 18 #include "chrome/browser/media_galleries/gallery_watch_manager_observer.h" |
| 19 #include "chrome/browser/media_galleries/media_file_system_registry.h" | 19 #include "chrome/browser/media_galleries/media_file_system_registry.h" |
| 20 #include "chrome/browser/media_galleries/media_scan_manager_observer.h" | 20 #include "chrome/browser/media_galleries/media_scan_manager_observer.h" |
| 21 #include "chrome/common/extensions/api/media_galleries.h" | 21 #include "chrome/common/extensions/api/media_galleries.h" |
| 22 #include "chrome/common/media_galleries/metadata_types.h" | 22 #include "chrome/common/media_galleries/metadata_types.h" |
| 23 #include "components/storage_monitor/media_storage_util.h" | 23 #include "components/storage_monitor/media_storage_util.h" |
| 24 #include "extensions/browser/browser_context_keyed_api_factory.h" | 24 #include "extensions/browser/browser_context_keyed_api_factory.h" |
| 25 #include "extensions/browser/event_router.h" | 25 #include "extensions/browser/event_router.h" |
| 26 #include "extensions/browser/extension_event_histogram_value.h" |
| 26 | 27 |
| 27 namespace MediaGalleries = extensions::api::media_galleries; | 28 namespace MediaGalleries = extensions::api::media_galleries; |
| 28 | 29 |
| 29 class MediaGalleriesScanResultController; | 30 class MediaGalleriesScanResultController; |
| 30 | 31 |
| 31 namespace content { | 32 namespace content { |
| 32 class BlobHandle; | 33 class BlobHandle; |
| 33 class WebContents; | 34 class WebContents; |
| 34 } | 35 } |
| 35 | 36 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 66 void OnScanCancelled(const std::string& extension_id) override; | 67 void OnScanCancelled(const std::string& extension_id) override; |
| 67 void OnScanFinished(const std::string& extension_id, | 68 void OnScanFinished(const std::string& extension_id, |
| 68 int gallery_count, | 69 int gallery_count, |
| 69 const MediaGalleryScanResult& file_counts) override; | 70 const MediaGalleryScanResult& file_counts) override; |
| 70 void OnScanError(const std::string& extension_id) override; | 71 void OnScanError(const std::string& extension_id) override; |
| 71 | 72 |
| 72 private: | 73 private: |
| 73 friend class BrowserContextKeyedAPIFactory<MediaGalleriesEventRouter>; | 74 friend class BrowserContextKeyedAPIFactory<MediaGalleriesEventRouter>; |
| 74 | 75 |
| 75 void DispatchEventToExtension(const std::string& extension_id, | 76 void DispatchEventToExtension(const std::string& extension_id, |
| 77 events::HistogramValue histogram_value, |
| 76 const std::string& event_name, | 78 const std::string& event_name, |
| 77 scoped_ptr<base::ListValue> event_args); | 79 scoped_ptr<base::ListValue> event_args); |
| 78 | 80 |
| 79 explicit MediaGalleriesEventRouter(content::BrowserContext* context); | 81 explicit MediaGalleriesEventRouter(content::BrowserContext* context); |
| 80 ~MediaGalleriesEventRouter() override; | 82 ~MediaGalleriesEventRouter() override; |
| 81 | 83 |
| 82 // BrowserContextKeyedAPI implementation. | 84 // BrowserContextKeyedAPI implementation. |
| 83 static const char* service_name() { | 85 static const char* service_name() { |
| 84 return "MediaGalleriesAPI"; | 86 return "MediaGalleriesAPI"; |
| 85 } | 87 } |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 ~MediaGalleriesRemoveAllGalleryWatchFunction() override; | 354 ~MediaGalleriesRemoveAllGalleryWatchFunction() override; |
| 353 bool RunAsync() override; | 355 bool RunAsync() override; |
| 354 | 356 |
| 355 private: | 357 private: |
| 356 void OnPreferencesInit(); | 358 void OnPreferencesInit(); |
| 357 }; | 359 }; |
| 358 | 360 |
| 359 } // namespace extensions | 361 } // namespace extensions |
| 360 | 362 |
| 361 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ | 363 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_MEDIA_GALLERIES_API_H_ |
| OLD | NEW |