Expose occlusion in WebContents and WebContentsObserver.

This CL:
- Adds content::Visibility {VISIBLE, OCCLUDED, HIDDEN}.
- Replaces
   bool WebContents::IsVisible();
  with
   Visibility WebContents::GetVisibility();
- Replaces
   void WebContents::WasShown();
   void WebContents::WasHidden();
  with
   void WebContents::OnVisibilityChanged(Visibility);

FAQ:

- What is the meaning of VISIBLE, OCCLUDED or HIDDEN?
    https://chromium-review.googlesource.com/c/chromium/src/+/867511/17/content/public/browser/visibility.h

- What should I consider when reviewing an updated call site?
    Before, WasShown()/WasHidden() were called for these
    transitions:
      visible or occluded -> hidden
      hidden -> visible or occluded
    Now, OnVisibilityChanged() is called for each of these
    transitions:
      VISIBLE -> OCCLUDED
      OCCLUDED -> VISIBLE
      HIDDEN -> VISIBLE:
      HIDDEN -> OCCLUDED
      VISIBLE -> HIDDEN
      OCCLUDED -> HIDDEN

- Why a single OnVisibilityChanged observer method instead of
  WasShown/WasHidden/WasOccluded?
    Having a single method makes it clearer that visibility
    states are mutually exclusive.

- Why do we need an OCCLUDED state?
    We plan to use it for metrics recording and to reduce
    resource usage in occluded tabs. This is important to
    improve the experience of users that use many windows.
    https://groups.google.com/a/google.com/d/msg/chrome-desktop/3Qp1857tqw4/E8Qp-YgoDQAJ

Bug: 668690
Change-Id: I7a6aa905619f51f5d5463f583bdb4640d57aff00
Reviewed-on: https://chromium-review.googlesource.com/867511
Commit-Queue: François Doray <[email protected]>
Reviewed-by: Sami Kyöstilä <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: Andrey Kosyakov <[email protected]>
Reviewed-by: Michael Giuffrida <[email protected]>
Reviewed-by: Ted Choc <[email protected]>
Reviewed-by: Olga Sharonova <[email protected]>
Reviewed-by: Robert Kaplow <[email protected]>
Reviewed-by: Mike Wittman <[email protected]>
Reviewed-by: rajendrant <[email protected]>
Reviewed-by: Sébastien Marchand <[email protected]>
Reviewed-by: Peter Kasting <[email protected]>
Reviewed-by: Carlos Knippschild <[email protected]>
Reviewed-by: Kevin McNee <[email protected]>
Reviewed-by: Mathieu Perreault <[email protected]>
Reviewed-by: Patti <[email protected]>
Reviewed-by: Yuri Wiitala <[email protected]>
Reviewed-by: Sergey Ulanov <[email protected]>
Reviewed-by: Vaclav Brozek <[email protected]>
Reviewed-by: Peter Beverloo <[email protected]>
Reviewed-by: Bryan McQuade <[email protected]>
Reviewed-by: Charlie Harrison <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Reviewed-by: Dominick Ng <[email protected]>
Cr-Commit-Position: refs/heads/master@{#537529}
84 files changed