Chromium Code Reviews| Index: chrome/browser/media/router/media_source_helper.h |
| diff --git a/chrome/browser/media/router/media_source_helper.h b/chrome/browser/media/router/media_source_helper.h |
| index a46294f870f5ce46391b034cc181572bfc9eb42f..32d66f0b33df1e28f3232a97cd41772d44f94d35 100644 |
| --- a/chrome/browser/media/router/media_source_helper.h |
| +++ b/chrome/browser/media/router/media_source_helper.h |
| @@ -8,25 +8,16 @@ |
| #include <string> |
| #include "chrome/browser/media/router/media_source.h" |
| +#include "chrome/browser/media/router/presentation_helper.h" |
| namespace media_router { |
| // Helper library for protocol-specific media source object creation. |
| - |
| -// TODO(kmarshall): Should these creation methods be moved to the WebUI, which |
| -// (excluding Presentation API) is their only caller? The MR base code can be |
| -// Also, consider generating an is_mirroring state boolean at the time of URN |
| -// creation so that the mirroring status does not have to be determined from a |
| -// string prefix check. |
| -// These changes would allow the MR to handle MediaSource objects in the same |
| -// type agnostic fashion vs. having to format and parse URNs and track which |
| -// MediaSource types are mirroring-enabled. |
| - |
| // Returns MediaSource URI depending on the type of source. |
| -MediaSource ForTabMediaSource(int tab_id); |
| -MediaSource ForDesktopMediaSource(); |
| -MediaSource ForCastAppMediaSource(const std::string& app_id); |
| -MediaSource ForPresentationUrl(const std::string& presentation_url); |
| +MediaSource MediaSourceForTab(int tab_id); |
|
mark a. foltz
2015/06/01 19:18:12
Rather than creating longer camel-cased names that
haibinlu
2015/06/01 21:44:58
Acknowledged.
|
| +MediaSource MediaSourceForDesktop(); |
| +MediaSource MediaSourceForCastApp(const std::string& app_id); |
| +MediaSource MediaSourceForPresentationUrl(const std::string& presentation_url); |
| // Returns true if |source| outputs its content via mirroring. |
| bool IsMirroringMediaSource(const MediaSource& source); |
| @@ -35,6 +26,10 @@ bool IsMirroringMediaSource(const MediaSource& source); |
| // Does not deeper protocol-level syntax checks. |
| bool IsValidMediaSource(const MediaSource& source); |
| +// Extracts the presentation URL from |source|. |
| +// If |source| is invalid, an empty string is returned. |
| +std::string PresentationUrlFromMediaSource(const MediaSource& source); |
| + |
| } // namespace media_router |
| #endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_HELPER_H_ |