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