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
3 // found in the LICENSE file.
5 // Manages events for the private Chrome extensions media galleries API. This
6 // is temporary and will be moved to a permanent, public place in the near
7 // future. This class object lives on the UI thread.
9 #ifndef CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_MEDIA_GALLERIES_PRIVATE_EVENT_ROUTER_H_
10 #define CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_MEDIA_GALLERIES_PRIVATE_EVENT_ROUTER_H_
15 #include "base/basictypes.h"
16 #include "base/compiler_specific.h"
17 #include "base/memory/scoped_ptr.h"
18 #include "base/memory/weak_ptr.h"
19 #include "chrome/browser/media_galleries/media_galleries_preferences.h"
20 #include "chrome/browser/storage_monitor/removable_storage_observer.h"
28 namespace extensions {
30 class MediaGalleriesPrivateEventRouter
31 : public RemovableStorageObserver,
32 public base::SupportsWeakPtr<MediaGalleriesPrivateEventRouter> {
34 explicit MediaGalleriesPrivateEventRouter(Profile* profile);
35 virtual ~MediaGalleriesPrivateEventRouter();
37 // Gallery changed event handler.
38 void OnGalleryChanged(MediaGalleryPrefId gallery_id,
39 const std::set<std::string>& extension_ids);
42 // RemovableStorageObserver implementation.
43 virtual void OnRemovableStorageAttached(const StorageInfo& info) OVERRIDE;
44 virtual void OnRemovableStorageDetached(const StorageInfo& info) OVERRIDE;
46 void DispatchEvent(const std::string& event_name,
47 scoped_ptr<base::ListValue> event_args);
52 DISALLOW_COPY_AND_ASSIGN(MediaGalleriesPrivateEventRouter);
55 } // namespace extensions
57 #endif // CHROME_BROWSER_EXTENSIONS_API_MEDIA_GALLERIES_PRIVATE_MEDIA_GALLERIES_PRIVATE_EVENT_ROUTER_H_