Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(558)

Unified Diff: trunk/src/content/browser/frame_host/cross_process_frame_connector.cc

Issue 295833002: Revert 271461 "Decouple RVH creation from CrossProcessFrameConne..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: trunk/src/content/browser/frame_host/cross_process_frame_connector.cc
===================================================================
--- trunk/src/content/browser/frame_host/cross_process_frame_connector.cc (revision 271515)
+++ trunk/src/content/browser/frame_host/cross_process_frame_connector.cc (working copy)
@@ -53,12 +53,9 @@
view_ = view;
- // Attach ourselves to the new view and size it appropriately.
- if (view_) {
+ // Attach ourselves to the new view.
+ if (view_)
view_->set_cross_process_frame_connector(this);
- SetDeviceScaleFactor(device_scale_factor_);
- SetSize(child_frame_rect_);
- }
}
void CrossProcessFrameConnector::RenderProcessGone() {
@@ -126,11 +123,20 @@
void CrossProcessFrameConnector::OnInitializeChildFrame(gfx::Rect frame_rect,
float scale_factor) {
- if (scale_factor != device_scale_factor_)
- SetDeviceScaleFactor(scale_factor);
+ if (scale_factor != device_scale_factor_) {
+ device_scale_factor_ = scale_factor;
+ if (view_) {
+ RenderWidgetHostImpl* child_widget =
+ RenderWidgetHostImpl::From(view_->GetRenderWidgetHost());
+ child_widget->NotifyScreenInfoChanged();
+ }
+ }
- if (!frame_rect.size().IsEmpty())
- SetSize(frame_rect);
+ if (!frame_rect.size().IsEmpty()) {
+ child_frame_rect_ = frame_rect;
+ if (view_)
+ view_->SetSize(frame_rect.size());
+ }
}
gfx::Rect CrossProcessFrameConnector::ChildFrameRect() {
@@ -169,19 +175,4 @@
}
}
-void CrossProcessFrameConnector::SetDeviceScaleFactor(float scale_factor) {
- device_scale_factor_ = scale_factor;
- if (view_) {
- RenderWidgetHostImpl* child_widget =
- RenderWidgetHostImpl::From(view_->GetRenderWidgetHost());
- child_widget->NotifyScreenInfoChanged();
- }
-}
-
-void CrossProcessFrameConnector::SetSize(gfx::Rect frame_rect) {
- child_frame_rect_ = frame_rect;
- if (view_)
- view_->SetSize(frame_rect.size());
-}
-
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698