Set up legacy window subclass and mouse hook during setForwardMouseMessages.

As opposed to when a legacy window is created/destroyed. This enables forwarding on a per-window basis.
This commit is contained in:
Andreas Flöjt 2017-08-14 18:12:55 +02:00
parent 0736de1e8d
commit 60c0bf1636
3 changed files with 39 additions and 39 deletions

View file

@ -267,10 +267,11 @@ class NativeWindowViews : public NativeWindow,
base::win::ScopedHICON window_icon_;
base::win::ScopedHICON app_icon_;
// Handles to legacy windows iterated by the mouse hook
static std::map<HWND, NativeWindowViews*> legacy_window_map_;
// The set of windows currently forwarding mouse messages.
static std::set<NativeWindowViews*> forwarding_windows_;
static HHOOK mouse_hook_;
bool forwarding_mouse_messages_ = false;
HWND legacy_window_ = NULL;
#endif
// Handles unhandled keyboard messages coming back from the renderer process.