Skip to content

Commit

Permalink
refactor: remove native_browser_view web contents get function (#25526)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaurencin committed Sep 21, 2020
1 parent a80c35d commit ea76788
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
6 changes: 0 additions & 6 deletions shell/browser/native_browser_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ InspectableWebContentsView* NativeBrowserView::GetInspectableWebContentsView() {
return inspectable_web_contents_->GetView();
}

content::WebContents* NativeBrowserView::GetWebContents() {
if (!inspectable_web_contents_)
return nullptr;
return inspectable_web_contents_->GetWebContents();
}

void NativeBrowserView::WebContentsDestroyed() {
inspectable_web_contents_ = nullptr;
}
Expand Down
1 change: 0 additions & 1 deletion shell/browser/native_browser_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ class NativeBrowserView : public content::WebContentsObserver {
}

InspectableWebContentsView* GetInspectableWebContentsView();
content::WebContents* GetWebContents();

virtual void SetAutoResizeFlags(uint8_t flags) = 0;
virtual void SetBounds(const gfx::Rect& bounds) = 0;
Expand Down
8 changes: 4 additions & 4 deletions shell/browser/native_browser_view_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ - (BOOL)mouseDownCanMoveWindow {

void NativeBrowserViewMac::UpdateDraggableRegions(
const std::vector<gfx::Rect>& drag_exclude_rects) {
auto* iwc_view = GetInspectableWebContentsView();
auto* web_contents = GetWebContents();
if (!(iwc_view && web_contents))
if (!inspectable_web_contents_)
return;
NSView* web_view = GetWebContents()->GetNativeView().GetNativeNSView();
auto* web_contents = inspectable_web_contents_->GetWebContents();
auto* iwc_view = GetInspectableWebContentsView();
NSView* web_view = web_contents->GetNativeView().GetNativeNSView();
NSView* inspectable_view = iwc_view->GetNativeView().GetNativeNSView();
NSView* window_content_view = inspectable_view.superview;
const auto window_content_view_height = NSHeight(window_content_view.bounds);
Expand Down

0 comments on commit ea76788

Please sign in to comment.