Commit dc9ad8da authored by Marina Ciocea's avatar Marina Ciocea Committed by Commit Bot

Use NativeWidgetAura for shared tab contents border widget on Windows.

On Windows, the default native widget type is DesktopNativeWidgetAura,
while on Linux it's NativeWidgetAura. This leads to different behavior
on Windows for contents border widget: clicks don't go through the
widget, z-ordering is incorrect (the border widget is always on top),
and the widget does not follow the browser window when dragged around.

Use a NativeWidgetAura on Windows as well to fix these issues.

Bug: 991896, 991954, 991921
Change-Id: Id9ea6101ae24dbf0cad6bfb162bed634aba22bca
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1742140
Commit-Queue: Marina Ciocea <marinaciocea@chromium.org>
Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#685325}
parent fb00198f
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/infobars/infobar_service.h" #include "chrome/browser/infobars/infobar_service.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser.h"
...@@ -23,6 +24,10 @@ ...@@ -23,6 +24,10 @@
#include "net/base/url_util.h" #include "net/base/url_util.h"
#include "ui/gfx/color_palette.h" #include "ui/gfx/color_palette.h"
#if defined(OS_WIN)
#include "ui/views/widget/native_widget_aura.h"
#endif
namespace { namespace {
const int kContentsBorderThickness = 10; const int kContentsBorderThickness = 10;
...@@ -49,6 +54,9 @@ void InitContentsBorderWidget(content::WebContents* contents) { ...@@ -49,6 +54,9 @@ void InitContentsBorderWidget(content::WebContents* contents) {
// Let events go through to underlying view. // Let events go through to underlying view.
params.accept_events = false; params.accept_events = false;
params.activatable = views::Widget::InitParams::ACTIVATABLE_NO; params.activatable = views::Widget::InitParams::ACTIVATABLE_NO;
#if defined(OS_WIN)
params.native_widget = new views::NativeWidgetAura(widget);
#endif
widget->Init(std::move(params)); widget->Init(std::move(params));
views::View* border_view = new views::View(); views::View* border_view = new views::View();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment