OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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. |
| 4 #ifndef CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_OBSERVERS_H_ |
| 5 #define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_OBSERVERS_H_ |
| 6 |
| 7 #include <map> |
| 8 |
| 9 #include "chrome/browser/media/router/render_frame_host_id.h" |
| 10 #include "content/public/browser/presentation_service_delegate.h" |
| 11 |
| 12 namespace media_router { |
| 13 |
| 14 class PresentationServiceDelegateObservers { |
| 15 public: |
| 16 PresentationServiceDelegateObservers(); |
| 17 virtual ~PresentationServiceDelegateObservers(); |
| 18 |
| 19 // Registers an observer associated with frame with |render_process_id| |
| 20 // and |render_frame_id| with this class to listen for updates. |
| 21 // This class does not own the observer. |
| 22 // It is an error to add an observer if there is already an observer for that |
| 23 // frame. |
| 24 virtual void AddObserver( |
| 25 int render_process_id, |
| 26 int render_frame_id, |
| 27 content::PresentationServiceDelegate::Observer* observer); |
| 28 |
| 29 // Unregisters the observer associated with the frame with |render_process_id| |
| 30 // and |render_frame_id|. |
| 31 // The observer will no longer receive updates. |
| 32 virtual void RemoveObserver(int render_process_id, int render_frame_id); |
| 33 |
| 34 private: |
| 35 std::map<RenderFrameHostId, content::PresentationServiceDelegate::Observer*> |
| 36 observers_; |
| 37 }; |
| 38 |
| 39 } // namespace media_router |
| 40 |
| 41 #endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_OBSERVERS_H
_ |
OLD | NEW |