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

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

Issue 949293004: Add media router common classes and unittests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bring GN files up to date. Created 5 years, 9 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
« no previous file with comments | « chrome/browser/media/router/media_source.cc ('k') | chrome/browser/media/router/media_source_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..a46294f870f5ce46391b034cc181572bfc9eb42f
--- /dev/null
+++ b/chrome/browser/media/router/media_source_helper.h
@@ -0,0 +1,40 @@
+// 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_MEDIA_SOURCE_HELPER_H_
+#define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_HELPER_H_
+
+#include <string>
+
+#include "chrome/browser/media/router/media_source.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);
+
+// Returns true if |source| outputs its content via mirroring.
+bool IsMirroringMediaSource(const MediaSource& source);
+
+// Checks that |source| is a parseable URN and is of a known type.
+// Does not deeper protocol-level syntax checks.
+bool IsValidMediaSource(const MediaSource& source);
+
+} // namespace media_router
+
+#endif // CHROME_BROWSER_MEDIA_ROUTER_MEDIA_SOURCE_HELPER_H_
« no previous file with comments | « chrome/browser/media/router/media_source.cc ('k') | chrome/browser/media/router/media_source_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698