Remove the explicit dependency between HTMLMediaElement and MediaControls
wrt the cast buttons.

OnRemotePlaybackAvailabilityChanged, OnRemotePlaybackConnecting,
and OnRemotePlaybackDisconnected are replaced by MediaControlsMediaEventListener
via an availability callback and listening for connect, connecting and disconnect
events on the RemotePlayback object off the MediaElement.

OnDisableRemotePlaybackAttributeChanged is replaced by a MutationObserver kept by
MediaControlsImpl.

RemotePlayback has methods that allow it to be used from C++ directly.

BUG=517102
TEST=existing and new tests + manual

Review-Url: https://codereview.chromium.org/2782373002
Cr-Original-Commit-Position: refs/heads/master@{#468223}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 77db41b769602da7ccc0106c285490f149fe343d
16 files changed
tree: ce423d97097276efdc63163acabe2369364e02c7
  1. accessibility-audit/
  2. accessibility_test_framework/
  3. adobe/
  4. afl/
  5. analytics/
  6. android_async_task/
  7. android_crazy_linker/
  8. android_data_chart/
  9. android_media/
  10. android_opengl/
  11. android_platform/
  12. android_protobuf/
  13. android_support_test_runner/
  14. android_swipe_refresh/
  15. apache-portable-runtime/
  16. apache-win32/
  17. apache_velocity/
  18. apk-patch-size-estimator/
  19. apple_apsl/
  20. apple_sample_code/
  21. ashmem/
  22. binutils/
  23. blanketjs/
  24. boringssl/
  25. bouncycastle/
  26. brotli/
  27. bspatch/
  28. byte_buddy/
  29. cacheinvalidation/
  30. ced/
  31. chaijs/
  32. checkstyle/
  33. cld/
  34. cld_2/
  35. cld_3/
  36. closure_compiler/
  37. colorama/
  38. crashpad/
  39. custom_tabs_client/
  40. d3/
  41. decklink/
  42. deqp/
  43. devscripts/
  44. dom_distiller_js/
  45. drmemory/
  46. elfutils/
  47. errorprone/
  48. espresso/
  49. expat/
  50. fips181/
  51. flatbuffers/
  52. flot/
  53. fontconfig/
  54. freetype/
  55. gardiner_mod/
  56. gestures/
  57. gif_player/
  58. glslang/
  59. glslang-angle/
  60. google_appengine_cloudstorage/
  61. google_input_tools/
  62. google_toolbox_for_mac/
  63. guava/
  64. gvr-android-sdk/
  65. haha/
  66. hamcrest/
  67. harfbuzz-ng/
  68. hunspell/
  69. iaccessible2/
  70. iccjpeg/
  71. icu4j/
  72. ijar/
  73. inspector_protocol/
  74. instrumented_libraries/
  75. intellij/
  76. isimpledom/
  77. javax_inject/
  78. jinja2/
  79. jmake/
  80. jsoncpp/
  81. jsr-305/
  82. jstemplate/
  83. junit/
  84. khronos/
  85. lcov/
  86. leakcanary/
  87. leveldatabase/
  88. libaddressinput/
  89. libdrm/
  90. libevdev/
  91. libFuzzer/
  92. libjingle_xmpp/
  93. libjpeg/
  94. liblouis/
  95. libphonenumber/
  96. libpng/
  97. libprotobuf-mutator/
  98. libsecret/
  99. libsync/
  100. libudev/
  101. libusb/
  102. libva/
  103. libvpx/
  104. libwebm/
  105. libwebp/
  106. libxml/
  107. libXNVCtrl/
  108. libxslt/
  109. logilab/
  110. lzma_sdk/
  111. mach_override/
  112. markdown/
  113. markupsafe/
  114. mesa/
  115. minigbm/
  116. mocha/
  117. mockito/
  118. modp_b64/
  119. molokocacao/
  120. motemplate/
  121. mozilla/
  122. mt19937ar/
  123. netty-tcnative/
  124. netty4/
  125. node/
  126. objenesis/
  127. ocmock/
  128. openh264/
  129. opus/
  130. ots/
  131. ow2_asm/
  132. pexpect/
  133. ply/
  134. polymer/
  135. proguard/
  136. protobuf/
  137. py_trace_event/
  138. pycoverage/
  139. pyftpdlib/
  140. pylint/
  141. pymock/
  142. Python-Markdown/
  143. pywebsocket/
  144. qcms/
  145. qunit/
  146. re2/
  147. requests/
  148. retrolambda/
  149. robolectric/
  150. sfntly/
  151. shaderc/
  152. simplejson/
  153. sinonjs/
  154. smhasher/
  155. snappy/
  156. speech-dispatcher/
  157. spirv-headers/
  158. SPIRV-Tools/
  159. spirv-tools-angle/
  160. sqlite/
  161. sqlite4java/
  162. sudden_motion_sensor/
  163. tcmalloc/
  164. tlslite/
  165. typ/
  166. ub-uiautomator/
  167. usb_ids/
  168. usrsctp/
  169. v4l-utils/
  170. visualmetrics/
  171. vulkan/
  172. vulkan-validation-layers/
  173. wayland/
  174. wayland-protocols/
  175. wds/
  176. web-animations-js/
  177. webdriver/
  178. webgl/
  179. WebKit/
  180. webrtc_overrides/
  181. widevine/
  182. woff2/
  183. wtl/
  184. xstream/
  185. yasm/
  186. zlib/
  187. .gitignore
  188. BUILD.gn
  189. DEPS
  190. OWNERS
  191. PRESUBMIT.py
  192. README.chromium
  193. README.chromium.template