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

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

Issue 964403003: Make it possible to set the display mode from Chromium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 resize_params->resizer_rect = GetRootWindowResizerRect(); 580 resize_params->resizer_rect = GetRootWindowResizerRect();
581 581
582 if (view_) { 582 if (view_) {
583 resize_params->new_size = view_->GetRequestedRendererSize(); 583 resize_params->new_size = view_->GetRequestedRendererSize();
584 resize_params->physical_backing_size = view_->GetPhysicalBackingSize(); 584 resize_params->physical_backing_size = view_->GetPhysicalBackingSize();
585 resize_params->top_controls_height = view_->GetTopControlsHeight(); 585 resize_params->top_controls_height = view_->GetTopControlsHeight();
586 resize_params->top_controls_shrink_blink_size = 586 resize_params->top_controls_shrink_blink_size =
587 view_->DoTopControlsShrinkBlinkSize(); 587 view_->DoTopControlsShrinkBlinkSize();
588 resize_params->visible_viewport_size = view_->GetVisibleViewportSize(); 588 resize_params->visible_viewport_size = view_->GetVisibleViewportSize();
589 resize_params->is_fullscreen = IsFullscreen(); 589 resize_params->is_fullscreen = IsFullscreen();
590 resize_params->display_mode = GetDisplayMode();
kenneth.christiansen 2015/03/06 12:21:29 isn't Isfullscreen included in the GetDisplayMode?
590 } 591 }
591 } 592 }
592 593
593 void RenderWidgetHostImpl::SetInitialRenderSizeParams( 594 void RenderWidgetHostImpl::SetInitialRenderSizeParams(
594 const ViewMsg_Resize_Params& resize_params) { 595 const ViewMsg_Resize_Params& resize_params) {
595 // We don't expect to receive an ACK when the requested size or the physical 596 // We don't expect to receive an ACK when the requested size or the physical
596 // backing size is empty, or when the main viewport size didn't change. 597 // backing size is empty, or when the main viewport size didn't change.
597 if (!resize_params.new_size.IsEmpty() && 598 if (!resize_params.new_size.IsEmpty() &&
598 !resize_params.physical_backing_size.IsEmpty()) { 599 !resize_params.physical_backing_size.IsEmpty()) {
599 resize_ack_pending_ = g_check_for_pending_resize_ack; 600 resize_ack_pending_ = g_check_for_pending_resize_ack;
(...skipping 19 matching lines...) Expand all
619 GetResizeParams(params.get()); 620 GetResizeParams(params.get());
620 if (old_resize_params_) { 621 if (old_resize_params_) {
621 size_changed = old_resize_params_->new_size != params->new_size; 622 size_changed = old_resize_params_->new_size != params->new_size;
622 width_changed = 623 width_changed =
623 old_resize_params_->new_size.width() != params->new_size.width(); 624 old_resize_params_->new_size.width() != params->new_size.width();
624 side_payload_changed = 625 side_payload_changed =
625 side_payload_changed || 626 side_payload_changed ||
626 old_resize_params_->physical_backing_size != 627 old_resize_params_->physical_backing_size !=
627 params->physical_backing_size || 628 params->physical_backing_size ||
628 old_resize_params_->is_fullscreen != params->is_fullscreen || 629 old_resize_params_->is_fullscreen != params->is_fullscreen ||
630 old_resize_params_->display_mode != params->display_mode ||
629 old_resize_params_->top_controls_height != 631 old_resize_params_->top_controls_height !=
630 params->top_controls_height || 632 params->top_controls_height ||
631 old_resize_params_->top_controls_shrink_blink_size != 633 old_resize_params_->top_controls_shrink_blink_size !=
632 params->top_controls_shrink_blink_size || 634 params->top_controls_shrink_blink_size ||
633 old_resize_params_->visible_viewport_size != 635 old_resize_params_->visible_viewport_size !=
634 params->visible_viewport_size; 636 params->visible_viewport_size;
635 } 637 }
636 638
637 if (!size_changed && !side_payload_changed) 639 if (!size_changed && !side_payload_changed)
638 return; 640 return;
(...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 } 1322 }
1321 1323
1322 bool RenderWidgetHostImpl::IsMouseLocked() const { 1324 bool RenderWidgetHostImpl::IsMouseLocked() const {
1323 return view_ ? view_->IsMouseLocked() : false; 1325 return view_ ? view_->IsMouseLocked() : false;
1324 } 1326 }
1325 1327
1326 bool RenderWidgetHostImpl::IsFullscreen() const { 1328 bool RenderWidgetHostImpl::IsFullscreen() const {
1327 return false; 1329 return false;
1328 } 1330 }
1329 1331
1332 blink::WebDisplayMode RenderWidgetHostImpl::GetDisplayMode() const {
1333 return blink::WebDisplayModeBrowser;
1334 }
1335
1330 void RenderWidgetHostImpl::SetAutoResize(bool enable, 1336 void RenderWidgetHostImpl::SetAutoResize(bool enable,
1331 const gfx::Size& min_size, 1337 const gfx::Size& min_size,
1332 const gfx::Size& max_size) { 1338 const gfx::Size& max_size) {
1333 auto_resize_enabled_ = enable; 1339 auto_resize_enabled_ = enable;
1334 min_size_for_auto_resize_ = min_size; 1340 min_size_for_auto_resize_ = min_size;
1335 max_size_for_auto_resize_ = max_size; 1341 max_size_for_auto_resize_ = max_size;
1336 } 1342 }
1337 1343
1338 void RenderWidgetHostImpl::Cleanup() { 1344 void RenderWidgetHostImpl::Cleanup() {
1339 if (view_) { 1345 if (view_) {
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
2200 } 2206 }
2201 #endif 2207 #endif
2202 2208
2203 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { 2209 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() {
2204 if (view_) 2210 if (view_)
2205 return view_->PreferredReadbackFormat(); 2211 return view_->PreferredReadbackFormat();
2206 return kN32_SkColorType; 2212 return kN32_SkColorType;
2207 } 2213 }
2208 2214
2209 } // namespace content 2215 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698