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

Unified Diff: chrome/browser/media/router/presentation_service_delegate_observers.h

Issue 2477573002: [Presentation API] (3rd) (1-UA) Split PresentationServiceDelegateImpl(PSDImpl) (Closed)
Patch Set: fix windows compile error Created 3 years, 11 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
Index: chrome/browser/media/router/presentation_service_delegate_observers.h
diff --git a/chrome/browser/media/router/presentation_service_delegate_observers.h b/chrome/browser/media/router/presentation_service_delegate_observers.h
new file mode 100644
index 0000000000000000000000000000000000000000..2783d2b0fe96b433848423b714756295a6f59fca
--- /dev/null
+++ b/chrome/browser/media/router/presentation_service_delegate_observers.h
@@ -0,0 +1,41 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+#ifndef CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_OBSERVERS_H_
+#define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_OBSERVERS_H_
+
+#include <map>
+
+#include "chrome/browser/media/router/render_frame_host_id.h"
+#include "content/public/browser/presentation_service_delegate.h"
+
+namespace media_router {
+
+class PresentationServiceDelegateObservers {
+ public:
+ PresentationServiceDelegateObservers();
+ virtual ~PresentationServiceDelegateObservers();
+
+ // Registers an observer associated with frame with |render_process_id|
+ // and |render_frame_id| with this class to listen for updates.
+ // This class does not own the observer.
+ // It is an error to add an observer if there is already an observer for that
+ // frame.
+ virtual void AddObserver(
+ int render_process_id,
+ int render_frame_id,
+ content::PresentationServiceDelegate::Observer* observer);
+
+ // Unregisters the observer associated with the frame with |render_process_id|
+ // and |render_frame_id|.
+ // The observer will no longer receive updates.
+ virtual void RemoveObserver(int render_process_id, int render_frame_id);
+
+ private:
+ std::map<RenderFrameHostId, content::PresentationServiceDelegate::Observer*>
+ observers_;
+};
+
+} // namespace media_router
+
+#endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_SERVICE_DELEGATE_OBSERVERS_H_

Powered by Google App Engine
This is Rietveld 408576698