Merge pull request #9440 from brenca/osr-fixes

Additional small OSR fixes
This commit is contained in:
Cheng Zhao 2017-05-17 17:14:27 +09:00 committed by GitHub
commit 9bed0ffdbf
4 changed files with 28 additions and 8 deletions

View file

@ -1660,6 +1660,18 @@ void WebContents::Invalidate() {
}
}
gfx::Size WebContents::GetSizeForNewRenderView(
content::WebContents* wc) const {
if (IsOffScreen() && wc == web_contents()) {
auto relay = NativeWindowRelay::FromWebContents(web_contents());
if (relay) {
return relay->window->GetSize();
}
}
return gfx::Size();
}
void WebContents::SetZoomLevel(double level) {
zoom_controller_->SetZoomLevel(level);
}

View file

@ -185,6 +185,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
void SetFrameRate(int frame_rate);
int GetFrameRate() const;
void Invalidate();
gfx::Size GetSizeForNewRenderView(content::WebContents*) const override;
// Methods for zoom handling.
void SetZoomLevel(double level);