Chromium Code Reviews| Index: chrome/browser/media/router/presentation_frame.h |
| diff --git a/chrome/browser/media/router/presentation_frame.h b/chrome/browser/media/router/presentation_frame.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..26a3ed2fcea33f3e12009bcf6a4c46ab30ac944a |
| --- /dev/null |
| +++ b/chrome/browser/media/router/presentation_frame.h |
| @@ -0,0 +1,65 @@ |
| +// Copyright 2015 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_FRAME_H_ |
| +#define CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_FRAME_H_ |
| + |
| +#include <map> |
| + |
| +#include "base/containers/scoped_ptr_hash_map.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "content/public/browser/presentation_service_delegate.h" |
| + |
| +namespace content { |
| +class PresentationScreenAvailabilityListener; |
| +class WebContents; |
| +} |
| + |
| +namespace media_router { |
| + |
| +// Helper class for PresentationServiceDelegateImpl to manage |
| +// listeners and default presentation info in a render frame. |
| +class PresentationFrame { |
|
mark a. foltz
2015/05/14 22:20:45
If this is used only by PSDI then I would declare
haibinlu
2015/05/15 23:32:29
Merged into PSDI.cc
|
| + public: |
| + using DelegateObserver = content::PresentationServiceDelegate::Observer; |
| + |
| + explicit PresentationFrame(content::WebContents* web_contents); |
| + ~PresentationFrame(); |
|
mark a. foltz
2015/05/14 22:20:45
virtual
haibinlu
2015/05/15 23:32:29
Done.
|
| + |
| + // Return true if listener was added. |
|
mark a. foltz
2015/05/14 22:20:45
s/Return/Returns/ here and below
haibinlu
2015/05/15 23:32:29
Done.
|
| + bool AddScreenAvailabilityListener( |
| + content::PresentationScreenAvailabilityListener* listener); |
| + // Return true if listener was deleted. |
| + bool RemoveScreenAvailabilityListener( |
| + content::PresentationScreenAvailabilityListener* listener); |
| + |
| + void SetDefaultPresentationInfo(const std::string& default_presentation_url, |
|
mark a. foltz
2015/05/14 22:20:45
Add docstring
haibinlu
2015/05/15 23:32:29
Done.
|
| + const std::string& default_presentation_id); |
| + // Return empty string if no default presentation ID is set. |
| + std::string GetDefaultPresentationId() const; |
| + |
| + void SetDelegateObserver(DelegateObserver* observer); |
|
mark a. foltz
2015/05/14 22:20:45
Add docstrings
haibinlu
2015/05/15 23:32:29
Done.
|
| + DelegateObserver* GetDelegateObserver() const; |
| + |
| + void Reset(); |
| + |
| + private: |
| + MediaSource GetMediaSourceFromListener( |
| + content::PresentationScreenAvailabilityListener* listener); |
| + |
| + // Not owned by this class. |
|
mark a. foltz
2015/05/14 22:20:45
What guarantees the lifetime of this?
|
| + DelegateObserver* delegate_observer_; |
| + |
| + scoped_ptr<content::PresentationSessionInfo> default_presentation_info_; |
| + base::ScopedPtrHashMap<MediaSourceId, scoped_ptr<MediaSinksObserver>> |
| + sink_observers_; |
| + |
| + // Does not own these two objects. |
| + MediaRouter* router_; |
| + content::WebContents* web_contents_; |
|
mark a. foltz
2015/05/14 22:20:45
Ditto for this
|
| +}; |
| + |
| +} // namespace media_router |
| + |
| +#endif // CHROME_BROWSER_MEDIA_ROUTER_PRESENTATION_FRAME_H_ |