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

Side by Side Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 847893002: Implemented explicit resizing from guestview. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 } 591 }
592 592
593 old_resize_params_ = 593 old_resize_params_ =
594 make_scoped_ptr(new ViewMsg_Resize_Params(resize_params)); 594 make_scoped_ptr(new ViewMsg_Resize_Params(resize_params));
595 } 595 }
596 596
597 void RenderWidgetHostImpl::WasResized() { 597 void RenderWidgetHostImpl::WasResized() {
598 // Skip if the |delegate_| has already been detached because 598 // Skip if the |delegate_| has already been detached because
599 // it's web contents is being deleted. 599 // it's web contents is being deleted.
600 if (resize_ack_pending_ || !process_->HasConnection() || !view_ || 600 if (resize_ack_pending_ || !process_->HasConnection() || !view_ ||
601 !renderer_initialized_ || auto_resize_enabled_ || !delegate_) { 601 !renderer_initialized_ || !delegate_)
602 return;
603
604 // |old_resize_params_| needs to be cleared when autoresize is enabled,
605 // because the next time a regular resize occurs, it is not meaningful to
606 // compare its new size to the old size from before autoresizing.
607 if (auto_resize_enabled_) {
608 old_resize_params_.reset();
Fady Samuel 2015/01/12 23:13:56 To land this, you're going to need to put it in a
paulmeyer 2015/01/12 23:25:19 Acknowledged.
602 return; 609 return;
603 } 610 }
604 611
605 bool size_changed = true; 612 bool size_changed = true;
606 bool side_payload_changed = screen_info_out_of_date_; 613 bool side_payload_changed = screen_info_out_of_date_;
607 scoped_ptr<ViewMsg_Resize_Params> params(new ViewMsg_Resize_Params); 614 scoped_ptr<ViewMsg_Resize_Params> params(new ViewMsg_Resize_Params);
608 615
609 GetResizeParams(params.get()); 616 GetResizeParams(params.get());
610 if (old_resize_params_) { 617 if (old_resize_params_) {
611 size_changed = old_resize_params_->new_size != params->new_size; 618 size_changed = old_resize_params_->new_size != params->new_size;
(...skipping 1547 matching lines...) Expand 10 before | Expand all | Expand 10 after
2159 } 2166 }
2160 #endif 2167 #endif
2161 2168
2162 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { 2169 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() {
2163 if (view_) 2170 if (view_)
2164 return view_->PreferredReadbackFormat(); 2171 return view_->PreferredReadbackFormat();
2165 return kN32_SkColorType; 2172 return kN32_SkColorType;
2166 } 2173 }
2167 2174
2168 } // namespace content 2175 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698