| 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/renderer_host/render_widget_host_impl.h" | 9 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 RenderWidgetHostView* rwhv) { | 25 RenderWidgetHostView* rwhv) { |
| 26 return static_cast<RenderWidgetHostViewPort*>(rwhv); | 26 return static_cast<RenderWidgetHostViewPort*>(rwhv); |
| 27 } | 27 } |
| 28 | 28 |
| 29 // static | 29 // static |
| 30 RenderWidgetHostViewPort* RenderWidgetHostViewPort::CreateViewForWidget( | 30 RenderWidgetHostViewPort* RenderWidgetHostViewPort::CreateViewForWidget( |
| 31 content::RenderWidgetHost* widget) { | 31 content::RenderWidgetHost* widget) { |
| 32 return FromRWHV(RenderWidgetHostView::CreateViewForWidget(widget)); | 32 return FromRWHV(RenderWidgetHostView::CreateViewForWidget(widget)); |
| 33 } | 33 } |
| 34 | 34 |
| 35 RenderWidgetHostViewBase::RenderWidgetHostViewBase() | 35 RenderWidgetHostViewBase::RenderWidgetHostViewBase( |
| 36 scoped_ptr<CompositingDelegate> delegate) |
| 36 : popup_type_(WebKit::WebPopupTypeNone), | 37 : popup_type_(WebKit::WebPopupTypeNone), |
| 37 mouse_locked_(false), | 38 mouse_locked_(false), |
| 38 showing_context_menu_(false), | 39 showing_context_menu_(false), |
| 39 selection_text_offset_(0), | 40 selection_text_offset_(0), |
| 40 selection_range_(ui::Range::InvalidRange()) { | 41 selection_range_(ui::Range::InvalidRange()), |
| 42 compositing_delegate_(delegate.Pass()) { |
| 41 } | 43 } |
| 42 | 44 |
| 43 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { | 45 RenderWidgetHostViewBase::~RenderWidgetHostViewBase() { |
| 44 DCHECK(!mouse_locked_); | 46 DCHECK(!mouse_locked_); |
| 45 } | 47 } |
| 46 | 48 |
| 47 void RenderWidgetHostViewBase::SetBackground(const SkBitmap& background) { | 49 void RenderWidgetHostViewBase::SetBackground(const SkBitmap& background) { |
| 48 background_ = background; | 50 background_ = background; |
| 49 } | 51 } |
| 50 | 52 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 67 | 69 |
| 68 void RenderWidgetHostViewBase::SetShowingContextMenu(bool showing) { | 70 void RenderWidgetHostViewBase::SetShowingContextMenu(bool showing) { |
| 69 DCHECK_NE(showing_context_menu_, showing); | 71 DCHECK_NE(showing_context_menu_, showing); |
| 70 showing_context_menu_ = showing; | 72 showing_context_menu_ = showing; |
| 71 } | 73 } |
| 72 | 74 |
| 73 bool RenderWidgetHostViewBase::IsMouseLocked() { | 75 bool RenderWidgetHostViewBase::IsMouseLocked() { |
| 74 return mouse_locked_; | 76 return mouse_locked_; |
| 75 } | 77 } |
| 76 | 78 |
| 79 gfx::GLSurfaceHandle RenderWidgetHostViewBase::GetCompositingSurface() { |
| 80 return compositing_delegate_->GetCompositingSurface(); |
| 81 } |
| 82 |
| 83 bool RenderWidgetHostViewBase::ResizeNeedsNewSurface() { |
| 84 return compositing_delegate_->ResizeNeedsNewSurface(); |
| 85 } |
| 86 |
| 87 void RenderWidgetHostViewBase::AcceleratedSurfaceNew(int32 width_in_pixel, int32
height_in_pixel, uint64* surface_handle, TransportDIB::Handle* shm_handle) { |
| 88 compositing_delegate_->AcceleratedSurfaceNew(width_in_pixel, height_in_pixel,
surface_handle, shm_handle); |
| 89 } |
| 90 |
| 91 void RenderWidgetHostViewBase::AcceleratedSurfaceRelease(uint64 surface_handle)
{ |
| 92 compositing_delegate_->AcceleratedSurfaceRelease(surface_handle); |
| 93 } |
| 94 |
| 95 void RenderWidgetHostViewBase::AcceleratedSurfacePostSubBuffer(const GpuHostMsg_
AcceleratedSurfacePostSubBuffer_Params& params_in_pixel, int gpu_host_id) { |
| 96 compositing_delegate_->AcceleratedSurfacePostSubBuffer(params_in_pixel, gpu_ho
st_id); |
| 97 } |
| 98 |
| 99 void RenderWidgetHostViewBase::AcceleratedSurfaceBuffersSwapped(const GpuHostMsg
_AcceleratedSurfaceBuffersSwapped_Params& params_in_pixel, int gpu_host_id) { |
| 100 compositing_delegate_->AcceleratedSurfaceBuffersSwapped(params_in_pixel, gpu_h
ost_id); |
| 101 } |
| 102 |
| 77 void RenderWidgetHostViewBase::UnhandledWheelEvent( | 103 void RenderWidgetHostViewBase::UnhandledWheelEvent( |
| 78 const WebKit::WebMouseWheelEvent& event) { | 104 const WebKit::WebMouseWheelEvent& event) { |
| 79 // Most implementations don't need to do anything here. | 105 // Most implementations don't need to do anything here. |
| 80 } | 106 } |
| 81 | 107 |
| 82 void RenderWidgetHostViewBase::SetPopupType(WebKit::WebPopupType popup_type) { | 108 void RenderWidgetHostViewBase::SetPopupType(WebKit::WebPopupType popup_type) { |
| 83 popup_type_ = popup_type; | 109 popup_type_ = popup_type; |
| 84 } | 110 } |
| 85 | 111 |
| 86 WebKit::WebPopupType RenderWidgetHostViewBase::GetPopupType() { | 112 WebKit::WebPopupType RenderWidgetHostViewBase::GetPopupType() { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 105 return; | 131 return; |
| 106 current_display_area_ = display.bounds(); | 132 current_display_area_ = display.bounds(); |
| 107 current_device_scale_factor_ = display.device_scale_factor(); | 133 current_device_scale_factor_ = display.device_scale_factor(); |
| 108 if (GetRenderWidgetHost()) { | 134 if (GetRenderWidgetHost()) { |
| 109 RenderWidgetHostImpl* impl = | 135 RenderWidgetHostImpl* impl = |
| 110 RenderWidgetHostImpl::From(GetRenderWidgetHost()); | 136 RenderWidgetHostImpl::From(GetRenderWidgetHost()); |
| 111 impl->NotifyScreenInfoChanged(); | 137 impl->NotifyScreenInfoChanged(); |
| 112 } | 138 } |
| 113 } | 139 } |
| 114 | 140 |
| 141 void RenderWidgetHostViewBase::CompositingDelegate::AcceleratedSurfaceNew(int32
width_in_pixel, int32 height_in_pixel, uint64* surface_handle, TransportDIB::Han
dle* shm_handle) { |
| 142 NOTIMPLEMENTED(); |
| 143 } |
| 144 |
| 145 void RenderWidgetHostViewBase::CompositingDelegate::AcceleratedSurfaceRelease(ui
nt64 surface_handle) { |
| 146 NOTIMPLEMENTED(); |
| 147 } |
| 148 |
| 149 RenderWidgetHostViewBase::CompositingDelegate::~CompositingDelegate() { |
| 150 } |
| 151 |
| 115 } // namespace content | 152 } // namespace content |
| OLD | NEW |