Support tooltips in ash windows
In windows ash mode, if a tooltip is going to be presented we end up
creating a desktop widget which is incorrect. The issue at hand
is the widget selection here:
views::NativeWidget* ChromeViewsDelegate::CreateNativeWidget(
views::Widget::InitParams::Type type,
views::internal::NativeWidgetDelegate* delegate,
gfx::NativeView parent) {
if (parent && type != views::Widget::InitParams::TYPE_MENU)
return new views::NativeWidgetAura(delegate);
if (chrome::GetHostDesktopTypeForNativeView(parent) == chrome::HOST_DESKTOP_TYPE_NATIVE)
return new views::DesktopNativeWidgetAura(delegate);
return NULL;
}
For a tooltip the |parent| is null and that ends up returning a
views::DesktopNativeWidgetAura which is wrong and causes a crash. In ash
we need to return NativeWidgetAura
The alternative to this change is to have GetHostDesktopTypeForNativeView()
return not chrome::HOST_DESKTOP_TYPE_NATIVE.
BUG=151718
TEST= hover on the page tumbnails in the NTP and see the tooltips
Review URL: https://codereview.chromium.org/
11344048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165709 0039d316-1c4b-4281-b951-d872f2087c98