Set overlay mode opacity hint properly

The compositor does not use an alpha channel on its surface when it does
not need to, for power efficiency reasons. AndroidOverlays require the
compositor's surface to not be opaque, in order to draw a transparent
quad, through which the AO surface (and video) can be seen. We are
calling this transparency mode 'overlay mode'.

This CL adds the necessary plumbing to let WebContents embedders know
when to enter overlay mode. It also adds overlay mode support to
content shell and Chrome.

Bug: 710186
Change-Id: Ib873b553e7cda8edafc535ed730c18d3e8d44b2a
Reviewed-on: https://chromium-review.googlesource.com/567773
Commit-Queue: Thomas Guilbert <[email protected]>
Reviewed-by: Charlie Reis <[email protected]>
Reviewed-by: Frank Liberato <[email protected]>
Reviewed-by: Bo Liu <[email protected]>
Reviewed-by: Ted Choc <[email protected]>
Cr-Commit-Position: refs/heads/master@{#491307}
diff --git a/content/shell/browser/shell_android.cc b/content/shell/browser/shell_android.cc
index 6784258..ad30c47 100644
--- a/content/shell/browser/shell_android.cc
+++ b/content/shell/browser/shell_android.cc
@@ -82,6 +82,11 @@
   return Java_Shell_getContentVideoViewEmbedder(env, java_object_);
 }
 
+void Shell::SetOverlayMode(bool use_overlay_mode) {
+  JNIEnv* env = base::android::AttachCurrentThread();
+  return Java_Shell_setOverlayMode(env, java_object_, use_overlay_mode);
+}
+
 void Shell::PlatformToggleFullscreenModeForTab(WebContents* web_contents,
                                                bool enter_fullscreen) {
   JNIEnv* env = AttachCurrentThread();