[Chromecast] Extract StartParams class for CWCSurfaceHelper.
This de-duplicates logic that appears in CastWebContentsActivity and CastWebContentsFragment, and allows some of the complicated procedural logic that appeared in CastWebContentsActivity's handleIntent() method to be expressed in a purely reactive paradigm. Added tests for Intent handling in CastWebContentsActivity. To make a clean, readable way to express that duplicate Intents should be deleted, this patch adds a unique() method to Observable, which creates an Observable that will not activate if its source is activated with a value that is equivalent to the previous activation value. To make the implementation of this new method readable, first() and changes() methods were also added to Observable. These are likely to be useful elsewhere. Bug: Internal b/36777136 Test: cast_base_junit_tests, cast_shell_junit_tests Change-Id: I42871ef4bcd5b20cba813edf5ef92e0a255bb1d8 Reviewed-on: https://chromium-review.googlesource.com/957873 Commit-Queue: Simeon Anfinrud <sanfin@chromium.org> Reviewed-by:Luke Halliwell <halliwell@chromium.org> Cr-Commit-Position: refs/heads/master@{#548126}
Showing
Please register or sign in to comment