|
@@ -35,8 +35,8 @@ void OffScreenWebContentsView::SetWebContents(
|
|
|
content::WebContents* web_contents) {
|
|
|
web_contents_ = web_contents;
|
|
|
|
|
|
- if (GetView())
|
|
|
- GetView()->InstallTransparency();
|
|
|
+ if (auto* view = GetView())
|
|
|
+ view->InstallTransparency();
|
|
|
}
|
|
|
|
|
|
void OffScreenWebContentsView::SetNativeWindow(NativeWindow* window) {
|
|
@@ -53,8 +53,8 @@ void OffScreenWebContentsView::SetNativeWindow(NativeWindow* window) {
|
|
|
|
|
|
void OffScreenWebContentsView::OnWindowResize() {
|
|
|
// In offscreen mode call RenderWidgetHostView's SetSize explicitly
|
|
|
- if (GetView())
|
|
|
- GetView()->SetSize(GetSize());
|
|
|
+ if (auto* view = GetView())
|
|
|
+ view->SetSize(GetSize());
|
|
|
}
|
|
|
|
|
|
void OffScreenWebContentsView::OnWindowClosed() {
|
|
@@ -107,7 +107,9 @@ content::DropData* OffScreenWebContentsView::GetDropData() const {
|
|
|
}
|
|
|
|
|
|
gfx::Rect OffScreenWebContentsView::GetViewBounds() const {
|
|
|
- return GetView() ? GetView()->GetViewBounds() : gfx::Rect();
|
|
|
+ if (auto* view = GetView())
|
|
|
+ return view->GetViewBounds();
|
|
|
+ return {};
|
|
|
}
|
|
|
|
|
|
void OffScreenWebContentsView::CreateView(gfx::NativeView context) {}
|
|
@@ -115,10 +117,8 @@ void OffScreenWebContentsView::CreateView(gfx::NativeView context) {}
|
|
|
content::RenderWidgetHostViewBase*
|
|
|
OffScreenWebContentsView::CreateViewForWidget(
|
|
|
content::RenderWidgetHost* render_widget_host) {
|
|
|
- if (render_widget_host->GetView()) {
|
|
|
- return static_cast<content::RenderWidgetHostViewBase*>(
|
|
|
- render_widget_host->GetView());
|
|
|
- }
|
|
|
+ if (auto* rwhv = render_widget_host->GetView())
|
|
|
+ return static_cast<content::RenderWidgetHostViewBase*>(rwhv);
|
|
|
|
|
|
return new OffScreenRenderWidgetHostView(
|
|
|
transparent_, painting_, GetFrameRate(), callback_, render_widget_host,
|
|
@@ -144,8 +144,8 @@ OffScreenWebContentsView::CreateViewForChildWidget(
|
|
|
void OffScreenWebContentsView::SetPageTitle(const std::u16string& title) {}
|
|
|
|
|
|
void OffScreenWebContentsView::RenderViewReady() {
|
|
|
- if (GetView())
|
|
|
- GetView()->InstallTransparency();
|
|
|
+ if (auto* view = GetView())
|
|
|
+ view->InstallTransparency();
|
|
|
}
|
|
|
|
|
|
void OffScreenWebContentsView::RenderViewHostChanged(
|
|
@@ -181,11 +181,9 @@ void OffScreenWebContentsView::UpdateDragOperation(
|
|
|
bool document_is_handling_drag) {}
|
|
|
|
|
|
void OffScreenWebContentsView::SetPainting(bool painting) {
|
|
|
- auto* view = GetView();
|
|
|
painting_ = painting;
|
|
|
- if (view != nullptr) {
|
|
|
+ if (auto* view = GetView())
|
|
|
view->SetPainting(painting);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
bool OffScreenWebContentsView::IsPainting() const {
|
|
@@ -195,11 +193,9 @@ bool OffScreenWebContentsView::IsPainting() const {
|
|
|
}
|
|
|
|
|
|
void OffScreenWebContentsView::SetFrameRate(int frame_rate) {
|
|
|
- auto* view = GetView();
|
|
|
frame_rate_ = frame_rate;
|
|
|
- if (view != nullptr) {
|
|
|
+ if (auto* view = GetView())
|
|
|
view->SetFrameRate(frame_rate);
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
int OffScreenWebContentsView::GetFrameRate() const {
|