| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 5 #ifndef CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
| 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 6 #define CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| 11 #include <deque> | 11 #include <deque> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "cc/resources/returned_resource.h" | 18 #include "cc/resources/returned_resource.h" |
| 19 #include "cc/surfaces/surface_factory_client.h" | 19 #include "cc/surfaces/surface_factory_client.h" |
| 20 #include "cc/surfaces/surface_id_allocator.h" | 20 #include "cc/surfaces/surface_id_allocator.h" |
| 21 #include "content/browser/compositor/image_transport_factory.h" | 21 #include "content/browser/compositor/image_transport_factory.h" |
| 22 #include "content/browser/renderer_host/event_with_latency_info.h" |
| 22 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 23 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 23 #include "content/common/content_export.h" | 24 #include "content/common/content_export.h" |
| 25 #include "content/common/input/input_event_ack_state.h" |
| 24 #include "content/public/browser/readback_types.h" | 26 #include "content/public/browser/readback_types.h" |
| 25 #include "ui/compositor/compositor.h" | 27 #include "ui/compositor/compositor.h" |
| 26 #include "ui/gfx/geometry/rect.h" | 28 #include "ui/gfx/geometry/rect.h" |
| 27 #include "ui/gfx/native_widget_types.h" | 29 #include "ui/gfx/native_widget_types.h" |
| 28 | 30 |
| 29 namespace cc { | 31 namespace cc { |
| 30 class SurfaceFactory; | 32 class SurfaceFactory; |
| 31 enum class SurfaceDrawStatus; | 33 enum class SurfaceDrawStatus; |
| 32 } | 34 } |
| 33 | 35 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 bool CanCopyToVideoFrame() const override; | 124 bool CanCopyToVideoFrame() const override; |
| 123 bool HasAcceleratedSurface(const gfx::Size& desired_size) override; | 125 bool HasAcceleratedSurface(const gfx::Size& desired_size) override; |
| 124 void OnSwapCompositorFrame(uint32_t output_surface_id, | 126 void OnSwapCompositorFrame(uint32_t output_surface_id, |
| 125 scoped_ptr<cc::CompositorFrame> frame) override; | 127 scoped_ptr<cc::CompositorFrame> frame) override; |
| 126 // Since the URL of content rendered by this class is not displayed in | 128 // Since the URL of content rendered by this class is not displayed in |
| 127 // the URL bar, this method does not need an implementation. | 129 // the URL bar, this method does not need an implementation. |
| 128 void ClearCompositorFrame() override {} | 130 void ClearCompositorFrame() override {} |
| 129 void GetScreenInfo(blink::WebScreenInfo* results) override; | 131 void GetScreenInfo(blink::WebScreenInfo* results) override; |
| 130 bool GetScreenColorProfile(std::vector<char>* color_profile) override; | 132 bool GetScreenColorProfile(std::vector<char>* color_profile) override; |
| 131 gfx::Rect GetBoundsInRootWindow() override; | 133 gfx::Rect GetBoundsInRootWindow() override; |
| 132 #if defined(USE_AURA) | |
| 133 void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch, | 134 void ProcessAckedTouchEvent(const TouchEventWithLatencyInfo& touch, |
| 134 InputEventAckState ack_result) override; | 135 InputEventAckState ack_result) override; |
| 135 #endif // defined(USE_AURA) | |
| 136 bool LockMouse() override; | 136 bool LockMouse() override; |
| 137 void UnlockMouse() override; | 137 void UnlockMouse() override; |
| 138 uint32_t GetSurfaceIdNamespace() override; | 138 uint32_t GetSurfaceIdNamespace() override; |
| 139 void ProcessKeyboardEvent(const NativeWebKeyboardEvent& event) override; | 139 void ProcessKeyboardEvent(const NativeWebKeyboardEvent& event) override; |
| 140 void ProcessMouseEvent(const blink::WebMouseEvent& event) override; | 140 void ProcessMouseEvent(const blink::WebMouseEvent& event) override; |
| 141 void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event) override; | 141 void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event) override; |
| 142 void ProcessTouchEvent(const blink::WebTouchEvent& event, |
| 143 const ui::LatencyInfo& latency) override; |
| 142 gfx::Point TransformPointToRootCoordSpace(const gfx::Point& point) override; | 144 gfx::Point TransformPointToRootCoordSpace(const gfx::Point& point) override; |
| 143 | 145 |
| 144 #if defined(OS_MACOSX) | 146 #if defined(OS_MACOSX) |
| 145 // RenderWidgetHostView implementation. | 147 // RenderWidgetHostView implementation. |
| 146 void SetActive(bool active) override; | 148 void SetActive(bool active) override; |
| 147 void SetWindowVisibility(bool visible) override; | 149 void SetWindowVisibility(bool visible) override; |
| 148 void WindowFrameChanged() override; | 150 void WindowFrameChanged() override; |
| 149 void ShowDefinitionForSelection() override; | 151 void ShowDefinitionForSelection() override; |
| 150 bool SupportsSpeech() const override; | 152 bool SupportsSpeech() const override; |
| 151 void SpeakSelection() override; | 153 void SpeakSelection() override; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 177 // Declared 'public' instead of 'protected' here to allow derived classes | 179 // Declared 'public' instead of 'protected' here to allow derived classes |
| 178 // to Bind() to it. | 180 // to Bind() to it. |
| 179 void SurfaceDrawn(uint32_t output_surface_id, cc::SurfaceDrawStatus drawn); | 181 void SurfaceDrawn(uint32_t output_surface_id, cc::SurfaceDrawStatus drawn); |
| 180 | 182 |
| 181 // Exposed for tests. | 183 // Exposed for tests. |
| 182 cc::SurfaceId SurfaceIdForTesting() const override; | 184 cc::SurfaceId SurfaceIdForTesting() const override; |
| 183 CrossProcessFrameConnector* FrameConnectorForTesting() const { | 185 CrossProcessFrameConnector* FrameConnectorForTesting() const { |
| 184 return frame_connector_; | 186 return frame_connector_; |
| 185 } | 187 } |
| 186 | 188 |
| 189 void RegisterSurfaceNamespaceId(); |
| 190 void UnregisterSurfaceNamespaceId(); |
| 191 |
| 187 protected: | 192 protected: |
| 188 friend class RenderWidgetHostView; | 193 friend class RenderWidgetHostView; |
| 189 friend class RenderWidgetHostViewChildFrameTest; | 194 friend class RenderWidgetHostViewChildFrameTest; |
| 190 friend class RenderWidgetHostViewGuestSurfaceTest; | 195 friend class RenderWidgetHostViewGuestSurfaceTest; |
| 191 | 196 |
| 192 // Clears current compositor surface, if one is in use. | 197 // Clears current compositor surface, if one is in use. |
| 193 void ClearCompositorSurfaceIfNecessary(); | 198 void ClearCompositorSurfaceIfNecessary(); |
| 194 | 199 |
| 195 void ProcessFrameSwappedCallbacks(); | 200 void ProcessFrameSwappedCallbacks(); |
| 196 | 201 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 // it convenient to swap() when processing the list. | 236 // it convenient to swap() when processing the list. |
| 232 FrameSwappedCallbackList frame_swapped_callbacks_; | 237 FrameSwappedCallbackList frame_swapped_callbacks_; |
| 233 | 238 |
| 234 base::WeakPtrFactory<RenderWidgetHostViewChildFrame> weak_factory_; | 239 base::WeakPtrFactory<RenderWidgetHostViewChildFrame> weak_factory_; |
| 235 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); | 240 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewChildFrame); |
| 236 }; | 241 }; |
| 237 | 242 |
| 238 } // namespace content | 243 } // namespace content |
| 239 | 244 |
| 240 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ | 245 #endif // CONTENT_BROWSER_FRAME_HOST_RENDER_WIDGET_HOST_VIEW_CHILD_FRAME_H_ |
| OLD | NEW |