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

Unified Diff: chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.h

Issue 15742010: Use MediaGalleryPreferences directly in GalleryWatchStateTracker interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make sure to get all call sites Created 7 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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.h
diff --git a/chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.h b/chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.h
index 559497abfb7a2ff409dd2aee3dcb8061b3b8872e..a017288e27f68b41fce92bbb86f04f0f9fada755 100644
--- a/chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.h
+++ b/chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.h
@@ -27,6 +27,8 @@ class Value;
namespace extensions {
+// This class is owned by the MediaGalleriesPrivateAPI, and is created on demand
+// along with the MediaGalleriesPrivateEventRouter.
class GalleryWatchStateTracker
: public content::NotificationObserver,
public base::SupportsWeakPtr<GalleryWatchStateTracker> {
@@ -53,9 +55,11 @@ class GalleryWatchStateTracker
// |has_permission| is set to true if the user granted permission to
// access the gallery associated with the |gallery_id| and is set to false
// if the user revoked the gallery permission.
- void OnGalleryPermissionChanged(const std::string& extension_id,
- chrome::MediaGalleryPrefId gallery_id,
- bool has_permission);
+ void OnGalleryPermissionChanged(
+ const std::string& extension_id,
+ chrome::MediaGalleryPrefId gallery_id,
+ bool has_permission,
+ chrome::MediaGalleriesPreferences* preferences);
// Returns a set of watched gallery identifiers for the extension specified
// by the |extension_id|.
@@ -64,7 +68,9 @@ class GalleryWatchStateTracker
// Removes all the gallery watchers associated with the extension specified
// by the |extension_id|.
- void RemoveAllGalleryWatchersForExtension(const std::string& extension_id);
+ void RemoveAllGalleryWatchersForExtension(
+ const std::string& extension_id,
+ chrome::MediaGalleriesPreferences* preferences);
private:
// Key: Gallery identifier.
@@ -91,12 +97,14 @@ class GalleryWatchStateTracker
// Sets up the gallery watcher on the receipt of granted gallery permission
// event.
void SetupGalleryWatch(const std::string& extension_id,
- chrome::MediaGalleryPrefId gallery_id);
+ chrome::MediaGalleryPrefId gallery_id,
+ chrome::MediaGalleriesPreferences* preferences);
// Removes the gallery watcher on the receipt of revoked gallery permission
// event.
void RemoveGalleryWatch(const std::string& extension_id,
- chrome::MediaGalleryPrefId gallery_id);
+ chrome::MediaGalleryPrefId gallery_id,
+ chrome::MediaGalleriesPreferences* preferences);
// Returns true if a gallery watcher exists for the extension.
// Set |has_active_watcher| to true to find if the gallery watcher is active.
« no previous file with comments | « no previous file | chrome/browser/extensions/api/media_galleries_private/gallery_watch_state_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698