Only grant permissions to new extensions from sync if they have the expected version
[chromium-blink-merge.git] / chrome / browser / media / router / presentation_media_sinks_observer.h
blob055713820f1844ff550d45b337ee6086789bd4a1
1 // Copyright 2015 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 #ifndef CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_MEDIA_SINKS_OBSERVER_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_MEDIA_SINKS_OBSERVER_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "chrome/browser/media/router/media_sinks_observer.h"
11 #include "content/public/browser/presentation_service_delegate.h"
13 namespace content {
14 class PresentationScreenAvailabilityListener;
17 namespace media_router {
19 class MediaRouter;
20 class MediaSource;
22 // Receives SinkQueryResults for |source| from |router| and propagates results
23 // to |listener|. |listener| is notified only when availability status has
24 // changed, i.e. sinks have become available or sinks are no longer available.
25 class PresentationMediaSinksObserver : public MediaSinksObserver {
26 public:
27 // |router|: Media router that publishes sink query results.
28 // |listener|: Notified when sinks availability changes.
29 // |source|: Filters available sink.
30 // Does not take ownership of |listener| or |router|.
31 PresentationMediaSinksObserver(
32 MediaRouter* router,
33 content::PresentationScreenAvailabilityListener* listener,
34 const MediaSource& source);
35 ~PresentationMediaSinksObserver() override;
37 // MediaSinksObserver implementation.
38 void OnSinksReceived(const std::vector<MediaSink>& result) override;
40 content::PresentationScreenAvailabilityListener* listener() const {
41 return listener_;
44 private:
45 enum Availability { UNKNOWN, AVAILABLE, UNAVAILABLE };
47 content::PresentationScreenAvailabilityListener* listener_;
48 Availability previous_availablity_;
50 DISALLOW_COPY_AND_ASSIGN(PresentationMediaSinksObserver);
53 } // namespace media_router
55 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_MEDIA_SINKS_OBSERVER_H_