From f2b988a0cee27e75e88d8042f763107aa80ababc Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Wed, 26 Apr 2017 12:49:30 -0400 Subject: [PATCH] Windows: Fix crash on touch press text selection (issue #2149) --- libcef/browser/browser_main.cc | 3 +++ libcef/browser/browser_main.h | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/libcef/browser/browser_main.cc b/libcef/browser/browser_main.cc index cdf893c3d..07cd86307 100644 --- a/libcef/browser/browser_main.cc +++ b/libcef/browser/browser_main.cc @@ -45,6 +45,7 @@ #include "ui/display/screen.h" #include "ui/views/test/desktop_test_views_delegate.h" #include "ui/views/widget/desktop_aura/desktop_screen.h" +#include "ui/wm/core/wm_state.h" #if defined(OS_WIN) #include "libcef/common/crash_reporting_win.h" @@ -134,6 +135,8 @@ void CefBrowserMainParts::ToolkitInitialized() { new views::DesktopTestViewsDelegate; + wm_state_.reset(new wm::WMState); + #if defined(OS_WIN) ui::CursorLoaderWin::SetCursorResourceModule( CefContentBrowserClient::Get()->GetResourceDllName()); diff --git a/libcef/browser/browser_main.h b/libcef/browser/browser_main.h index 05ff1b9a0..0a7b58552 100644 --- a/libcef/browser/browser_main.h +++ b/libcef/browser/browser_main.h @@ -30,6 +30,12 @@ class ExtensionsBrowserClient; class ExtensionsClient; } +#if defined(USE_AURA) +namespace wm { +class WMState; +} +#endif + class CefBrowserContextImpl; class CefDevToolsDelegate; @@ -66,6 +72,10 @@ class CefBrowserMainParts : public content::BrowserMainParts { std::unique_ptr extensions_client_; std::unique_ptr extensions_browser_client_; +#if defined(USE_AURA) + std::unique_ptr wm_state_; +#endif + DISALLOW_COPY_AND_ASSIGN(CefBrowserMainParts); };