| 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 <IOSurface/IOSurfaceAPI.h> | |
| 10 #include <list> | 9 #include <list> |
| 11 #include <map> | 10 #include <map> |
| 12 #include <string> | 11 #include <string> |
| 13 #include <utility> | 12 #include <utility> |
| 14 #include <vector> | 13 #include <vector> |
| 15 | 14 |
| 16 #include "base/mac/scoped_nsobject.h" | 15 #include "base/mac/scoped_nsobject.h" |
| 17 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 18 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 19 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 20 #include "content/browser/compositor/browser_compositor_view_mac.h" | 19 #include "content/browser/compositor/browser_compositor_view_mac.h" |
| 21 #include "content/browser/compositor/delegated_frame_host.h" | 20 #include "content/browser/compositor/delegated_frame_host.h" |
| 22 #include "content/browser/renderer_host/compositing_iosurface_layer_mac.h" | |
| 23 #include "content/browser/renderer_host/display_link_mac.h" | 21 #include "content/browser/renderer_host/display_link_mac.h" |
| 24 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 22 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 25 #include "content/browser/renderer_host/software_frame_manager.h" | 23 #include "content/browser/renderer_host/software_frame_manager.h" |
| 26 #include "content/common/content_export.h" | 24 #include "content/common/content_export.h" |
| 27 #include "content/common/cursors/webcursor.h" | 25 #include "content/common/cursors/webcursor.h" |
| 28 #include "content/common/edit_command.h" | 26 #include "content/common/edit_command.h" |
| 29 #import "content/public/browser/render_widget_host_view_mac_base.h" | 27 #import "content/public/browser/render_widget_host_view_mac_base.h" |
| 30 #include "ipc/ipc_sender.h" | 28 #include "ipc/ipc_sender.h" |
| 31 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 29 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
| 32 #include "ui/base/cocoa/base_view.h" | 30 #include "ui/base/cocoa/base_view.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 // "The lifetime of the RenderWidgetHost* is tied to the render process. | 198 // "The lifetime of the RenderWidgetHost* is tied to the render process. |
| 201 // If the render process dies, the RenderWidgetHost* goes away and all | 199 // If the render process dies, the RenderWidgetHost* goes away and all |
| 202 // references to it must become NULL." | 200 // references to it must become NULL." |
| 203 // | 201 // |
| 204 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 202 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
| 205 class CONTENT_EXPORT RenderWidgetHostViewMac | 203 class CONTENT_EXPORT RenderWidgetHostViewMac |
| 206 : public RenderWidgetHostViewBase, | 204 : public RenderWidgetHostViewBase, |
| 207 public DelegatedFrameHostClient, | 205 public DelegatedFrameHostClient, |
| 208 public BrowserCompositorViewMacClient, | 206 public BrowserCompositorViewMacClient, |
| 209 public IPC::Sender, | 207 public IPC::Sender, |
| 210 public CompositingIOSurfaceLayerClient, | |
| 211 public gfx::DisplayObserver { | 208 public gfx::DisplayObserver { |
| 212 public: | 209 public: |
| 213 // The view will associate itself with the given widget. The native view must | 210 // The view will associate itself with the given widget. The native view must |
| 214 // be hooked up immediately to the view hierarchy, or else when it is | 211 // be hooked up immediately to the view hierarchy, or else when it is |
| 215 // deleted it will delete this out from under the caller. | 212 // deleted it will delete this out from under the caller. |
| 216 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); | 213 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); |
| 217 virtual ~RenderWidgetHostViewMac(); | 214 virtual ~RenderWidgetHostViewMac(); |
| 218 | 215 |
| 219 RenderWidgetHostViewCocoa* cocoa_view() const { return cocoa_view_; } | 216 RenderWidgetHostViewCocoa* cocoa_view() const { return cocoa_view_; } |
| 220 | 217 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 virtual bool LockMouse() OVERRIDE; | 319 virtual bool LockMouse() OVERRIDE; |
| 323 virtual void UnlockMouse() OVERRIDE; | 320 virtual void UnlockMouse() OVERRIDE; |
| 324 virtual void WheelEventAck(const blink::WebMouseWheelEvent& event, | 321 virtual void WheelEventAck(const blink::WebMouseWheelEvent& event, |
| 325 InputEventAckState ack_result) OVERRIDE; | 322 InputEventAckState ack_result) OVERRIDE; |
| 326 | 323 |
| 327 // IPC::Sender implementation. | 324 // IPC::Sender implementation. |
| 328 virtual bool Send(IPC::Message* message) OVERRIDE; | 325 virtual bool Send(IPC::Message* message) OVERRIDE; |
| 329 | 326 |
| 330 virtual SkColorType PreferredReadbackFormat() OVERRIDE; | 327 virtual SkColorType PreferredReadbackFormat() OVERRIDE; |
| 331 | 328 |
| 332 // CompositingIOSurfaceLayerClient implementation. | |
| 333 virtual bool AcceleratedLayerShouldAckImmediately() const OVERRIDE; | |
| 334 virtual void AcceleratedLayerDidDrawFrame() OVERRIDE; | |
| 335 virtual void AcceleratedLayerHitError() OVERRIDE; | |
| 336 | |
| 337 // gfx::DisplayObserver implementation. | 329 // gfx::DisplayObserver implementation. |
| 338 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; | 330 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; |
| 339 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; | 331 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; |
| 340 virtual void OnDisplayMetricsChanged(const gfx::Display& display, | 332 virtual void OnDisplayMetricsChanged(const gfx::Display& display, |
| 341 uint32_t metrics) OVERRIDE; | 333 uint32_t metrics) OVERRIDE; |
| 342 | 334 |
| 343 // Forwards the mouse event to the renderer. | 335 // Forwards the mouse event to the renderer. |
| 344 void ForwardMouseEvent(const blink::WebMouseEvent& event); | 336 void ForwardMouseEvent(const blink::WebMouseEvent& event); |
| 345 | 337 |
| 346 void KillSelf(); | 338 void KillSelf(); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 | 512 |
| 521 // The current caret bounds. | 513 // The current caret bounds. |
| 522 gfx::Rect caret_rect_; | 514 gfx::Rect caret_rect_; |
| 523 | 515 |
| 524 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 516 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
| 525 }; | 517 }; |
| 526 | 518 |
| 527 } // namespace content | 519 } // namespace content |
| 528 | 520 |
| 529 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 521 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
| OLD | NEW |