Make ScreenWakeLock ContextLifecycleObserver instead of LocalFrameLifecycleObserver

It is wrong to override LocalFrameLifecycleObserver::willDetachFromFrameHost
because it is not called when you expect it being called (it is not called when a page navigates).
I believe what you really want is to observe ContextLifecycleObserver::contextDestroyed,
which is called when a document is detached.

Also I don't see any reason ScreenWakeLock needs to observer didCommitLoad.
I think that observing ContextLifecycleObserver::contextDestroyed would be enough.
Currently ScreenWakeLock is the only customer of didCommitLoad.

BUG=610176

Review-Url: https://codereview.chromium.org/2126733002
Cr-Commit-Position: refs/heads/master@{#404052}
3 files changed