mac: Move draggable region code to BrowserWindow

On macOS current draggable region implementation highly relies on
WebContents, the code is only meaningful for BrowserWindow.
This commit is contained in:
Cheng Zhao 2018-03-06 14:44:36 +09:00
parent bc34ca9e25
commit 503b0ba1b1
10 changed files with 127 additions and 132 deletions

View file

@ -261,6 +261,10 @@ class BrowserWindow : public mate::TrackableObject<BrowserWindow>,
content::RenderFrameHost* rfh,
const std::vector<DraggableRegion>& regions);
// Convert draggable regions in raw format to SkRegion format.
std::unique_ptr<SkRegion> DraggableRegionsToSkRegion(
const std::vector<DraggableRegion>& regions);
// Schedule a notification unresponsive event.
void ScheduleUnresponsiveEvent(int ms);
@ -272,6 +276,10 @@ class BrowserWindow : public mate::TrackableObject<BrowserWindow>,
MessageCallbackMap messages_callback_map_;
#endif
#if defined(OS_MACOSX)
std::vector<DraggableRegion> draggable_regions_;
#endif
// Closure that would be called when window is unresponsive when closing,
// it should be cancelled when we can prove that the window is responsive.
base::CancelableClosure window_unresponsive_closure_;