| 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 "content/browser/accessibility/browser_accessibility_manager.h" | 8 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 9 #include "content/browser/gpu/gpu_data_manager_impl.h" | 9 #include "content/browser/gpu/gpu_data_manager_impl.h" |
| 10 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" | 10 #include "content/browser/renderer_host/input/synthetic_gesture_target_base.h" |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 namespace { | 360 namespace { |
| 361 | 361 |
| 362 // How many microseconds apart input events should be flushed. | 362 // How many microseconds apart input events should be flushed. |
| 363 const int kFlushInputRateInUs = 16666; | 363 const int kFlushInputRateInUs = 16666; |
| 364 | 364 |
| 365 } | 365 } |
| 366 | 366 |
| 367 RenderWidgetHostViewBase::RenderWidgetHostViewBase() | 367 RenderWidgetHostViewBase::RenderWidgetHostViewBase() |
| 368 : popup_type_(blink::WebPopupTypeNone), | 368 : popup_type_(blink::WebPopupTypeNone), |
| 369 background_opaque_(true), | 369 background_opaque_(true), |
| 370 background_color_(SK_ColorWHITE), |
| 370 mouse_locked_(false), | 371 mouse_locked_(false), |
| 371 showing_context_menu_(false), | 372 showing_context_menu_(false), |
| 372 selection_text_offset_(0), | 373 selection_text_offset_(0), |
| 373 selection_range_(gfx::Range::InvalidRange()), | 374 selection_range_(gfx::Range::InvalidRange()), |
| 374 current_device_scale_factor_(0), | 375 current_device_scale_factor_(0), |
| 375 current_display_rotation_(gfx::Display::ROTATE_0), | 376 current_display_rotation_(gfx::Display::ROTATE_0), |
| 376 pinch_zoom_enabled_(content::IsPinchToZoomEnabled()), | 377 pinch_zoom_enabled_(content::IsPinchToZoomEnabled()), |
| 377 renderer_frame_number_(0), | 378 renderer_frame_number_(0), |
| 378 weak_factory_(this) { | 379 weak_factory_(this) { |
| 379 } | 380 } |
| 380 | 381 |
| 381 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { | 382 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { |
| 382 DCHECK(!mouse_locked_); | 383 DCHECK(!mouse_locked_); |
| 383 } | 384 } |
| 384 | 385 |
| 385 bool RenderWidgetHostViewBase::OnMessageReceived(const IPC::Message& msg){ | 386 bool RenderWidgetHostViewBase::OnMessageReceived(const IPC::Message& msg){ |
| 386 return false; | 387 return false; |
| 387 } | 388 } |
| 388 | 389 |
| 389 void RenderWidgetHostViewBase::SetBackgroundOpaque(bool opaque) { | 390 void RenderWidgetHostViewBase::SetBackgroundOpaque(bool opaque) { |
| 390 background_opaque_ = opaque; | 391 background_opaque_ = opaque; |
| 391 } | 392 } |
| 392 | 393 |
| 393 bool RenderWidgetHostViewBase::GetBackgroundOpaque() { | 394 bool RenderWidgetHostViewBase::GetBackgroundOpaque() { |
| 394 return background_opaque_; | 395 return background_opaque_; |
| 395 } | 396 } |
| 396 | 397 |
| 398 void RenderWidgetHostViewBase::SetBackgroundColor(SkColor color) { |
| 399 background_color_ = color; |
| 400 } |
| 401 |
| 397 gfx::Size RenderWidgetHostViewBase::GetPhysicalBackingSize() const { | 402 gfx::Size RenderWidgetHostViewBase::GetPhysicalBackingSize() const { |
| 398 gfx::NativeView view = GetNativeView(); | 403 gfx::NativeView view = GetNativeView(); |
| 399 gfx::Display display = | 404 gfx::Display display = |
| 400 gfx::Screen::GetScreenFor(view)->GetDisplayNearestWindow(view); | 405 gfx::Screen::GetScreenFor(view)->GetDisplayNearestWindow(view); |
| 401 return gfx::ToCeiledSize(gfx::ScaleSize(GetRequestedRendererSize(), | 406 return gfx::ToCeiledSize(gfx::ScaleSize(GetRequestedRendererSize(), |
| 402 display.device_scale_factor())); | 407 display.device_scale_factor())); |
| 403 } | 408 } |
| 404 | 409 |
| 405 float RenderWidgetHostViewBase::GetTopControlsLayoutHeight() const { | 410 float RenderWidgetHostViewBase::GetTopControlsLayoutHeight() const { |
| 406 return 0.f; | 411 return 0.f; |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 ? blink::WebScreenOrientationPortraitPrimary | 686 ? blink::WebScreenOrientationPortraitPrimary |
| 682 : blink::WebScreenOrientationPortraitSecondary; | 687 : blink::WebScreenOrientationPortraitSecondary; |
| 683 } | 688 } |
| 684 | 689 |
| 685 return primary_landscape_angle == angle | 690 return primary_landscape_angle == angle |
| 686 ? blink::WebScreenOrientationLandscapePrimary | 691 ? blink::WebScreenOrientationLandscapePrimary |
| 687 : blink::WebScreenOrientationLandscapeSecondary; | 692 : blink::WebScreenOrientationLandscapeSecondary; |
| 688 } | 693 } |
| 689 | 694 |
| 690 } // namespace content | 695 } // namespace content |
| OLD | NEW |