// Copyright (c) 2018 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include "shell/browser/api/electron_api_browser_window.h" #include "shell/browser/native_window_views.h" #include "ui/aura/window.h" namespace electron { namespace api { void BrowserWindow::UpdateDraggableRegions( const std::vector& regions) { if (window_->has_frame()) return; if (&draggable_regions_ != ®ions) { auto* nv = web_contents()->GetNativeView(); if (nv) { auto const offset = nv->GetBoundsInRootWindow(); auto snapped_regions = mojo::Clone(regions); for (auto& snapped_region : snapped_regions) { snapped_region->bounds.Offset(offset.x(), offset.y()); } draggable_regions_ = mojo::Clone(snapped_regions); } } static_cast(window_.get()) ->UpdateDraggableRegions(draggable_regions_); } } // namespace api } // namespace electron