| 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <utility> | 12 #include <utility> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/mac/scoped_nsobject.h" | 15 #include "base/mac/scoped_nsobject.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "content/browser/accessibility/browser_accessibility_delegate_mac.h" | 19 #include "content/browser/accessibility/browser_accessibility_delegate_mac.h" |
| 20 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 20 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 21 #include "content/browser/renderer_host/software_framebuffer.h" |
| 21 #include "content/common/edit_command.h" | 22 #include "content/common/edit_command.h" |
| 22 #import "content/public/browser/render_widget_host_view_mac_base.h" | 23 #import "content/public/browser/render_widget_host_view_mac_base.h" |
| 23 #include "ipc/ipc_sender.h" | 24 #include "ipc/ipc_sender.h" |
| 24 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 25 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
| 25 #include "ui/base/cocoa/base_view.h" | 26 #include "ui/base/cocoa/base_view.h" |
| 26 #include "webkit/common/cursors/webcursor.h" | 27 #include "webkit/common/cursors/webcursor.h" |
| 27 | 28 |
| 28 namespace content { | 29 namespace content { |
| 29 class CompositingIOSurfaceMac; | 30 class CompositingIOSurfaceMac; |
| 30 class CompositingIOSurfaceContext; | 31 class CompositingIOSurfaceContext; |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // to display the data. | 190 // to display the data. |
| 190 // | 191 // |
| 191 // Comment excerpted from render_widget_host.h: | 192 // Comment excerpted from render_widget_host.h: |
| 192 // | 193 // |
| 193 // "The lifetime of the RenderWidgetHost* is tied to the render process. | 194 // "The lifetime of the RenderWidgetHost* is tied to the render process. |
| 194 // If the render process dies, the RenderWidgetHost* goes away and all | 195 // If the render process dies, the RenderWidgetHost* goes away and all |
| 195 // references to it must become NULL." | 196 // references to it must become NULL." |
| 196 // | 197 // |
| 197 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 198 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
| 198 class RenderWidgetHostViewMac : public RenderWidgetHostViewBase, | 199 class RenderWidgetHostViewMac : public RenderWidgetHostViewBase, |
| 200 public SoftwareFramebufferClient, |
| 199 public IPC::Sender { | 201 public IPC::Sender { |
| 200 public: | 202 public: |
| 201 virtual ~RenderWidgetHostViewMac(); | 203 virtual ~RenderWidgetHostViewMac(); |
| 202 | 204 |
| 203 RenderWidgetHostViewCocoa* cocoa_view() const { return cocoa_view_; } | 205 RenderWidgetHostViewCocoa* cocoa_view() const { return cocoa_view_; } |
| 204 | 206 |
| 205 CONTENT_EXPORT void SetDelegate( | 207 CONTENT_EXPORT void SetDelegate( |
| 206 NSObject<RenderWidgetHostViewMacDelegate>* delegate); | 208 NSObject<RenderWidgetHostViewMacDelegate>* delegate); |
| 207 void SetAllowOverlappingViews(bool overlapping); | 209 void SetAllowOverlappingViews(bool overlapping); |
| 208 | 210 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE; | 278 const base::Callback<void(bool, const SkBitmap&)>& callback) OVERRIDE; |
| 277 virtual void CopyFromCompositingSurfaceToVideoFrame( | 279 virtual void CopyFromCompositingSurfaceToVideoFrame( |
| 278 const gfx::Rect& src_subrect, | 280 const gfx::Rect& src_subrect, |
| 279 const scoped_refptr<media::VideoFrame>& target, | 281 const scoped_refptr<media::VideoFrame>& target, |
| 280 const base::Callback<void(bool)>& callback) OVERRIDE; | 282 const base::Callback<void(bool)>& callback) OVERRIDE; |
| 281 virtual bool CanCopyToVideoFrame() const OVERRIDE; | 283 virtual bool CanCopyToVideoFrame() const OVERRIDE; |
| 282 virtual bool CanSubscribeFrame() const OVERRIDE; | 284 virtual bool CanSubscribeFrame() const OVERRIDE; |
| 283 virtual void BeginFrameSubscription( | 285 virtual void BeginFrameSubscription( |
| 284 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) OVERRIDE; | 286 scoped_ptr<RenderWidgetHostViewFrameSubscriber> subscriber) OVERRIDE; |
| 285 virtual void EndFrameSubscription() OVERRIDE; | 287 virtual void EndFrameSubscription() OVERRIDE; |
| 288 virtual void OnSwapCompositorFrame( |
| 289 uint32 output_surface_id, |
| 290 scoped_ptr<cc::CompositorFrame> frame) OVERRIDE; |
| 286 virtual void OnAcceleratedCompositingStateChange() OVERRIDE; | 291 virtual void OnAcceleratedCompositingStateChange() OVERRIDE; |
| 287 virtual void OnAccessibilityEvents( | 292 virtual void OnAccessibilityEvents( |
| 288 const std::vector<AccessibilityHostMsg_EventParams>& params | 293 const std::vector<AccessibilityHostMsg_EventParams>& params |
| 289 ) OVERRIDE; | 294 ) OVERRIDE; |
| 290 virtual bool PostProcessEventForPluginIme( | 295 virtual bool PostProcessEventForPluginIme( |
| 291 const NativeWebKeyboardEvent& event) OVERRIDE; | 296 const NativeWebKeyboardEvent& event) OVERRIDE; |
| 292 | 297 |
| 293 virtual void AcceleratedSurfaceBuffersSwapped( | 298 virtual void AcceleratedSurfaceBuffersSwapped( |
| 294 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, | 299 const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, |
| 295 int gpu_host_id) OVERRIDE; | 300 int gpu_host_id) OVERRIDE; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 306 | 311 |
| 307 virtual void SetHasHorizontalScrollbar( | 312 virtual void SetHasHorizontalScrollbar( |
| 308 bool has_horizontal_scrollbar) OVERRIDE; | 313 bool has_horizontal_scrollbar) OVERRIDE; |
| 309 virtual void SetScrollOffsetPinning( | 314 virtual void SetScrollOffsetPinning( |
| 310 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; | 315 bool is_pinned_to_left, bool is_pinned_to_right) OVERRIDE; |
| 311 virtual bool LockMouse() OVERRIDE; | 316 virtual bool LockMouse() OVERRIDE; |
| 312 virtual void UnlockMouse() OVERRIDE; | 317 virtual void UnlockMouse() OVERRIDE; |
| 313 virtual void UnhandledWheelEvent( | 318 virtual void UnhandledWheelEvent( |
| 314 const WebKit::WebMouseWheelEvent& event) OVERRIDE; | 319 const WebKit::WebMouseWheelEvent& event) OVERRIDE; |
| 315 | 320 |
| 321 // SoftwareFramebufferClient implementation. |
| 322 virtual void CurrentSoftwareFrameWasDiscarded() OVERRIDE {} |
| 323 |
| 316 // IPC::Sender implementation. | 324 // IPC::Sender implementation. |
| 317 virtual bool Send(IPC::Message* message) OVERRIDE; | 325 virtual bool Send(IPC::Message* message) OVERRIDE; |
| 318 | 326 |
| 319 // Forwards the mouse event to the renderer. | 327 // Forwards the mouse event to the renderer. |
| 320 void ForwardMouseEvent(const WebKit::WebMouseEvent& event); | 328 void ForwardMouseEvent(const WebKit::WebMouseEvent& event); |
| 321 | 329 |
| 322 void KillSelf(); | 330 void KillSelf(); |
| 323 | 331 |
| 324 void SetTextInputActive(bool active); | 332 void SetTextInputActive(bool active); |
| 325 | 333 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 bool can_compose_inline_; | 413 bool can_compose_inline_; |
| 406 | 414 |
| 407 base::scoped_nsobject<CALayer> software_layer_; | 415 base::scoped_nsobject<CALayer> software_layer_; |
| 408 | 416 |
| 409 // Accelerated compositing structures. These may be dynamically created and | 417 // Accelerated compositing structures. These may be dynamically created and |
| 410 // destroyed together in Create/DestroyCompositedIOSurfaceAndLayer. | 418 // destroyed together in Create/DestroyCompositedIOSurfaceAndLayer. |
| 411 base::scoped_nsobject<CompositingIOSurfaceLayer> compositing_iosurface_layer_; | 419 base::scoped_nsobject<CompositingIOSurfaceLayer> compositing_iosurface_layer_; |
| 412 scoped_ptr<CompositingIOSurfaceMac> compositing_iosurface_; | 420 scoped_ptr<CompositingIOSurfaceMac> compositing_iosurface_; |
| 413 scoped_refptr<CompositingIOSurfaceContext> compositing_iosurface_context_; | 421 scoped_refptr<CompositingIOSurfaceContext> compositing_iosurface_context_; |
| 414 | 422 |
| 423 // Framebuffer for software compositing. |
| 424 scoped_ptr<SoftwareFramebuffer> software_framebuffer_; |
| 425 |
| 415 // Whether to allow overlapping views. | 426 // Whether to allow overlapping views. |
| 416 bool allow_overlapping_views_; | 427 bool allow_overlapping_views_; |
| 417 | 428 |
| 418 // Whether to use the CoreAnimation path to draw content. | 429 // Whether to use the CoreAnimation path to draw content. |
| 419 bool use_core_animation_; | 430 bool use_core_animation_; |
| 420 | 431 |
| 421 ui::LatencyInfo software_latency_info_; | 432 ui::LatencyInfo software_latency_info_; |
| 422 | 433 |
| 423 NSWindow* pepper_fullscreen_window() const { | 434 NSWindow* pepper_fullscreen_window() const { |
| 424 return pepper_fullscreen_window_; | 435 return pepper_fullscreen_window_; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 | 567 |
| 557 // Subscriber that listens to frame presentation events. | 568 // Subscriber that listens to frame presentation events. |
| 558 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; | 569 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; |
| 559 | 570 |
| 560 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 571 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
| 561 }; | 572 }; |
| 562 | 573 |
| 563 } // namespace content | 574 } // namespace content |
| 564 | 575 |
| 565 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 576 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| OLD | NEW |