Reland "Fix app window titlebar blending with direct composition"

This is a reland of 5ad4e08d15110e8212fae941d4638e2e4df7e4c1

The only change is that we clear the DWM frame on the first
WM_ERASEBKGND message after frame type changes instead of doing it for
every message.  This fixes https://crbug.com/918461

Original change's description:
> Fix app window titlebar blending with direct composition
>
> Clear the DWM frame area on WM_ERASEBKGND so that Chrome's client area
> blends with DWM frame for app windows.  Refactor the code to update and
> clear DWM frame and move it to hwnd message handler so that browser and
> app windows can share the same code.
>
> This mimics existing logic for updating the DWM frame and adds the clear
> DWM frame behavior to app windows, but one notable change is that it
> will clear on every WM_ERASEBKGND message, and not just the first one.
> This shouldn't have a performance impact and seems more correct anyway.
>
> Bug: 904322
> Change-Id: I70c3ae97a94114dd63110736a35cef4dd887b1aa
> Reviewed-on: https://chromium-review.googlesource.com/c/1382928
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Bret Sepulveda <bsep@chromium.org>
> Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#618684}

Bug: 904322, 918461
Change-Id: I032ff424d204cb20d724f6be26b3e6fc8d5d0ec0
Reviewed-on: https://chromium-review.googlesource.com/c/1410388
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Sunny Sachanandani <sunnyps@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622883}
9 files changed