From 5128cb0b04dc75dfe1efb3cc921a73726eafc318 Mon Sep 17 00:00:00 2001 From: Michaela Laurencin Date: Wed, 16 Sep 2020 11:34:59 -0700 Subject: [PATCH] Fix mac name mismatch and make variable name more clear --- shell/browser/native_browser_view_mac.mm | 36 +++++++++++----------- shell/browser/native_browser_view_views.cc | 36 +++++++++++----------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/shell/browser/native_browser_view_mac.mm b/shell/browser/native_browser_view_mac.mm index 2ae4cacab8285..b844281f059f8 100644 --- a/shell/browser/native_browser_view_mac.mm +++ b/shell/browser/native_browser_view_mac.mm @@ -162,10 +162,10 @@ - (BOOL)mouseDownCanMoveWindow { NativeBrowserViewMac::NativeBrowserViewMac( InspectableWebContents* inspectable_web_contents) : NativeBrowserView(inspectable_web_contents) { - auto* contents = GetInspectableWebContentsView(); - if (!contents) + auto* iwc_view = GetInspectableWebContentsView(); + if (!iwc_view) return; - auto* view = contents->GetNativeView().GetNativeNSView(); + auto* view = iwc_view->GetNativeView().GetNativeNSView(); view.autoresizingMask = kDefaultAutoResizingMask; } @@ -188,18 +188,18 @@ - (BOOL)mouseDownCanMoveWindow { NSViewMaxYMargin | NSViewMinYMargin | NSViewHeightSizable; } - auto* contents = GetInspectableWebContentsView(); - if (!contents) + auto* iwc_view = GetInspectableWebContentsView(); + if (!iwc_view) return; - auto* view = contents->GetNativeView().GetNativeNSView(); + auto* view = iwc_view->GetNativeView().GetNativeNSView(); view.autoresizingMask = autoresizing_mask; } void NativeBrowserViewMac::SetBounds(const gfx::Rect& bounds) { - auto* contents = GetInspectableWebContentsView(); - if (!contents) + auto* iwc_view = GetInspectableWebContentsView(); + if (!iwc_view) return; - auto* view = contents->GetNativeView().GetNativeNSView(); + auto* view = iwc_view->GetNativeView().GetNativeNSView(); auto* superview = view.superview; const auto superview_height = superview ? superview.frame.size.height : 0; view.frame = @@ -208,10 +208,10 @@ - (BOOL)mouseDownCanMoveWindow { } gfx::Rect NativeBrowserViewMac::GetBounds() { - auto* contents = GetInspectableWebContentsView(); - if (!contents) + auto* iwc_view = GetInspectableWebContentsView(); + if (!iwc_view) return gfx::Rect(); - NSView* view = contents->GetNativeView().GetNativeNSView(); + NSView* view = iwc_view->GetNativeView().GetNativeNSView(); const int superview_height = (view.superview) ? view.superview.frame.size.height : 0; return gfx::Rect( @@ -221,22 +221,22 @@ - (BOOL)mouseDownCanMoveWindow { } void NativeBrowserViewMac::SetBackgroundColor(SkColor color) { - auto* contents = GetInspectableWebContentsView(); - if (!contents) + auto* iwc_view = GetInspectableWebContentsView(); + if (!iwc_view) return; - auto* view = contents->GetNativeView().GetNativeNSView(); + auto* view = iwc_view->GetNativeView().GetNativeNSView(); view.wantsLayer = YES; view.layer.backgroundColor = skia::CGColorCreateFromSkColor(color); } void NativeBrowserViewMac::UpdateDraggableRegions( const std::vector& drag_exclude_rects) { - auto* inspectable_contents = GetInspectableWebContentsView(); + auto* iwc_view = GetInspectableWebContentsView(); auto* web_contents = GetWebContents(); - if (!(inspectable_contents && web_contents)) + if (!(iwc_view && web_contents)) return; NSView* web_view = GetWebContents()->GetNativeView().GetNativeNSView(); - NSView* inspectable_view = 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); diff --git a/shell/browser/native_browser_view_views.cc b/shell/browser/native_browser_view_views.cc index cbe6968433583..cd1a2382f79cb 100644 --- a/shell/browser/native_browser_view_views.cc +++ b/shell/browser/native_browser_view_views.cc @@ -26,10 +26,10 @@ void NativeBrowserViewViews::SetAutoResizeProportions( const gfx::Size& window_size) { if ((auto_resize_flags_ & AutoResizeFlags::kAutoResizeHorizontal) && !auto_horizontal_proportion_set_) { - auto* contents = GetInspectableWebContentsView(); - if (contents) + auto* iwc_view = GetInspectableWebContentsView(); + if (iwc_view) return; - auto* view = contents->GetView(); + auto* view = iwc_view->GetView(); auto view_bounds = view->bounds(); auto_horizontal_proportion_width_ = static_cast(window_size.width()) / @@ -40,10 +40,10 @@ void NativeBrowserViewViews::SetAutoResizeProportions( } if ((auto_resize_flags_ & AutoResizeFlags::kAutoResizeVertical) && !auto_vertical_proportion_set_) { - auto* contents = GetInspectableWebContentsView(); - if (contents) + auto* iwc_view = GetInspectableWebContentsView(); + if (iwc_view) return; - auto* view = contents->GetView(); + auto* view = iwc_view->GetView(); auto view_bounds = view->bounds(); auto_vertical_proportion_height_ = static_cast(window_size.height()) / @@ -57,10 +57,10 @@ void NativeBrowserViewViews::SetAutoResizeProportions( void NativeBrowserViewViews::AutoResize(const gfx::Rect& new_window, int width_delta, int height_delta) { - auto* contents = GetInspectableWebContentsView(); - if (contents) + auto* iwc_view = GetInspectableWebContentsView(); + if (iwc_view) return; - auto* view = contents->GetView(); + auto* view = iwc_view->GetView(); const auto flags = GetAutoResizeFlags(); if (!(flags & kAutoResizeWidth)) { width_delta = 0; @@ -101,26 +101,26 @@ void NativeBrowserViewViews::ResetAutoResizeProportions() { } void NativeBrowserViewViews::SetBounds(const gfx::Rect& bounds) { - auto* contents = GetInspectableWebContentsView(); - if (!contents) + auto* iwc_view = GetInspectableWebContentsView(); + if (!iwc_view) return; - auto* view = contents->GetView(); + auto* view = iwc_view->GetView(); view->SetBoundsRect(bounds); ResetAutoResizeProportions(); } gfx::Rect NativeBrowserViewViews::GetBounds() { - auto* contents = GetInspectableWebContentsView(); - if (!contents) + auto* iwc_view = GetInspectableWebContentsView(); + if (!iwc_view) return gfx::Rect(); - return contents->GetView()->bounds(); + return iwc_view->GetView()->bounds(); } void NativeBrowserViewViews::SetBackgroundColor(SkColor color) { - auto* contents = GetInspectableWebContentsView(); - if (!contents) + auto* iwc_view = GetInspectableWebContentsView(); + if (!iwc_view) return; - auto* view = contents->GetView(); + auto* view = iwc_view->GetView(); view->SetBackground(views::CreateSolidBackground(color)); view->SchedulePaint(); }