Save browser_view_ in the NativeWindow
No need to store it separately in subclasses.
This commit is contained in:
parent
503b0ba1b1
commit
3b3e69f8b2
8 changed files with 34 additions and 33 deletions
|
@ -6,8 +6,7 @@
|
|||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include "atom/browser/native_browser_view_mac.h"
|
||||
#include "atom/browser/native_window_mac.h"
|
||||
#include "atom/browser/native_browser_view.h"
|
||||
#include "atom/common/draggable_region.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
|
||||
|
@ -90,9 +89,8 @@ void BrowserWindow::UpdateDraggableRegions(
|
|||
DraggableRegionsToSkRegion(regions), webViewWidth, webViewHeight);
|
||||
}
|
||||
|
||||
NativeWindowMac* window = static_cast<NativeWindowMac*>(window_.get());
|
||||
if (window->browser_view())
|
||||
window->browser_view()->UpdateDraggableRegions(system_drag_exclude_areas);
|
||||
if (window_->browser_view())
|
||||
window_->browser_view()->UpdateDraggableRegions(system_drag_exclude_areas);
|
||||
|
||||
// Create and add a ControlRegionView for each region that needs to be
|
||||
// excluded from the dragging.
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
#include "atom/browser/api/atom_api_browser_window.h"
|
||||
|
||||
#include "atom/browser/native_window_views.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
namespace api {
|
||||
|
@ -13,7 +15,8 @@ void BrowserWindow::UpdateDraggableRegions(
|
|||
const std::vector<DraggableRegion>& regions) {
|
||||
if (window_->has_frame())
|
||||
return;
|
||||
window_->UpdateDraggableRegions(DraggableRegionsToSkRegion(regions));
|
||||
static_cast<NativeWindowViews*>(window_.get())->UpdateDraggableRegions(
|
||||
DraggableRegionsToSkRegion(regions));
|
||||
}
|
||||
|
||||
} // namespace api
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue