[chromecast] MediaBlock: Added cast renderer initialization block.

Allowed a new type of media block that blocks cast_renderer
initialization instead of webmediaplayer loading.

Test: Manual test blocking is happening at the renderer by inspecting
device logs
Bug: b/134961542

Change-Id: I97b0e59a6752c43d14b8e96327079aa8669b1c00
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1673829
Reviewed-by: Sean Topping <[email protected]>
Reviewed-by: Yuchen Liu <[email protected]>
Auto-Submit: Andres Medina <[email protected]>
Commit-Queue: Andres Medina <[email protected]>
Cr-Commit-Position: refs/heads/master@{#672687}
diff --git a/chromecast/browser/cast_renderer_block_data.h b/chromecast/browser/cast_renderer_block_data.h
new file mode 100644
index 0000000..c5a7965
--- /dev/null
+++ b/chromecast/browser/cast_renderer_block_data.h
@@ -0,0 +1,49 @@
+// Copyright 2019 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 CHROMECAST_BROWSER_CAST_RENDERER_BLOCK_DATA_H_
+#define CHROMECAST_BROWSER_CAST_RENDERER_BLOCK_DATA_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
+#include "base/supports_user_data.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace chromecast {
+namespace media {
+class ApplicationMediaInfoManager;
+}
+
+namespace shell {
+
+class CastRendererBlockData : public base::SupportsUserData::Data {
+ public:
+  static void SetRendererBlockForWebContents(content::WebContents* web_contents,
+                                             bool blocked);
+  static void SetApplicationMediaInfoManagerForWebContents(
+      content::WebContents* web_contents,
+      media::ApplicationMediaInfoManager* application_media_info_manager);
+  CastRendererBlockData();
+  ~CastRendererBlockData() override;
+
+  bool blocked() const { return blocked_; }
+  void SetBlocked(bool blocked);
+  void SetApplicationMediaInfoManager(
+      media::ApplicationMediaInfoManager* application_media_info_manager);
+
+ private:
+  bool blocked_;
+  base::WeakPtr<media::ApplicationMediaInfoManager>
+      application_media_info_manager_;
+};
+
+}  // namespace shell
+}  // namespace chromecast
+
+#endif  // CHROMECAST_BROWSER_CAST_RENDERER_BLOCK_DATA_H_