OLD | NEW |
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_view_base.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "content/browser/accessibility/browser_accessibility_manager.h" | 9 #include "content/browser/accessibility/browser_accessibility_manager.h" |
10 #include "content/browser/gpu/gpu_data_manager_impl.h" | 10 #include "content/browser/gpu/gpu_data_manager_impl.h" |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 394 |
395 void RenderWidgetHostViewBase::SetBackgroundColorToDefault() { | 395 void RenderWidgetHostViewBase::SetBackgroundColorToDefault() { |
396 SetBackgroundColor(SK_ColorWHITE); | 396 SetBackgroundColor(SK_ColorWHITE); |
397 } | 397 } |
398 | 398 |
399 bool RenderWidgetHostViewBase::GetBackgroundOpaque() { | 399 bool RenderWidgetHostViewBase::GetBackgroundOpaque() { |
400 return SkColorGetA(background_color_) == SK_AlphaOPAQUE; | 400 return SkColorGetA(background_color_) == SK_AlphaOPAQUE; |
401 } | 401 } |
402 | 402 |
403 gfx::Size RenderWidgetHostViewBase::GetPhysicalBackingSize() const { | 403 gfx::Size RenderWidgetHostViewBase::GetPhysicalBackingSize() const { |
404 gfx::NativeView view = GetNativeView(); | |
405 gfx::Display display = | 404 gfx::Display display = |
406 gfx::Screen::GetScreenFor(view)->GetDisplayNearestWindow(view); | 405 gfx::Screen::GetScreen()->GetDisplayNearestWindow(GetNativeView()); |
407 return gfx::ScaleToCeiledSize(GetRequestedRendererSize(), | 406 return gfx::ScaleToCeiledSize(GetRequestedRendererSize(), |
408 display.device_scale_factor()); | 407 display.device_scale_factor()); |
409 } | 408 } |
410 | 409 |
411 bool RenderWidgetHostViewBase::DoTopControlsShrinkBlinkSize() const { | 410 bool RenderWidgetHostViewBase::DoTopControlsShrinkBlinkSize() const { |
412 return false; | 411 return false; |
413 } | 412 } |
414 | 413 |
415 float RenderWidgetHostViewBase::GetTopControlsHeight() const { | 414 float RenderWidgetHostViewBase::GetTopControlsHeight() const { |
416 return 0.f; | 415 return 0.f; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 | 527 |
529 if (impl) | 528 if (impl) |
530 impl->SendScreenRects(); | 529 impl->SendScreenRects(); |
531 | 530 |
532 if (HasDisplayPropertyChanged(view) && impl) | 531 if (HasDisplayPropertyChanged(view) && impl) |
533 impl->NotifyScreenInfoChanged(); | 532 impl->NotifyScreenInfoChanged(); |
534 } | 533 } |
535 | 534 |
536 bool RenderWidgetHostViewBase::HasDisplayPropertyChanged(gfx::NativeView view) { | 535 bool RenderWidgetHostViewBase::HasDisplayPropertyChanged(gfx::NativeView view) { |
537 gfx::Display display = | 536 gfx::Display display = |
538 gfx::Screen::GetScreenFor(view)->GetDisplayNearestWindow(view); | 537 gfx::Screen::GetScreen()->GetDisplayNearestWindow(view); |
539 if (current_display_area_ == display.work_area() && | 538 if (current_display_area_ == display.work_area() && |
540 current_device_scale_factor_ == display.device_scale_factor() && | 539 current_device_scale_factor_ == display.device_scale_factor() && |
541 current_display_rotation_ == display.rotation()) { | 540 current_display_rotation_ == display.rotation()) { |
542 return false; | 541 return false; |
543 } | 542 } |
544 | 543 |
545 current_display_area_ = display.work_area(); | 544 current_display_area_ = display.work_area(); |
546 current_device_scale_factor_ = display.device_scale_factor(); | 545 current_device_scale_factor_ = display.device_scale_factor(); |
547 current_display_rotation_ = display.rotation(); | 546 current_display_rotation_ = display.rotation(); |
548 return true; | 547 return true; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 } | 694 } |
696 | 695 |
697 void RenderWidgetHostViewBase::TransformPointToLocalCoordSpace( | 696 void RenderWidgetHostViewBase::TransformPointToLocalCoordSpace( |
698 const gfx::Point& point, | 697 const gfx::Point& point, |
699 cc::SurfaceId original_surface, | 698 cc::SurfaceId original_surface, |
700 gfx::Point* transformed_point) { | 699 gfx::Point* transformed_point) { |
701 *transformed_point = point; | 700 *transformed_point = point; |
702 } | 701 } |
703 | 702 |
704 } // namespace content | 703 } // namespace content |
OLD | NEW |