[Presentation API] Implement ondefaultsessionstart in PSImpl.
commit79ddfb2383dca537e481eb9e0a477267dd48bc60
authorimcheng <imcheng@google.com>
Wed, 22 Apr 2015 19:07:13 +0000 (22 12:07 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 22 Apr 2015 19:08:28 +0000 (22 19:08 +0000)
treec6f81d3a3a80e4cd112888c8033f182563be339f
parentc432cac0a0beb77c63081536fc9d53b40e642cbf
[Presentation API] Implement ondefaultsessionstart in PSImpl.

Added DefaultSessionStartContext for coordinating sending default
session back to PresentationDispatcher.

When ListenForDefaultSessionStart is called, DefaultSessionStartContext
will be installed on PresentationServiceImpl. When both the default
session and PresentationDispatcher's callback are available, the
callback will be invoked with the session.

On Reset(), if a callback is available, it will be invoked with null.
Changed PresentationDispatcher to not update Blink in that case.

Also, PSImpl now keeps track of the corresponding RFH's ID instead of
RFH* since most of the time we only need to use the ID.

Changed PresentationServiceDelegate's Add/RemoveObserver interface,
since the PresentationServiceDelegate need to be able to correlate
an Observer with a RFH. (at most 1 per RFH, as it stands today).

Added OnDefaultPresentationStarted to
PresentationServiceDelegate::Observer interface and implemented it
in PresentationServiceImpl.

Added tests in PresentationServiceImpl.

BUG=459001

Review URL: https://codereview.chromium.org/1073893003

Cr-Commit-Position: refs/heads/master@{#326353}
content/browser/presentation/presentation_service_impl.cc
content/browser/presentation/presentation_service_impl.h
content/browser/presentation/presentation_service_impl_unittest.cc
content/common/presentation/presentation_service.mojom
content/public/browser/presentation_service_delegate.h
content/renderer/presentation/presentation_dispatcher.cc