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> |
(...skipping 13 matching lines...) Expand all Loading... |
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" |
33 #include "ui/base/cocoa/remote_layer_api.h" | 33 #include "ui/base/cocoa/remote_layer_api.h" |
| 34 #include "ui/gfx/display_observer.h" |
34 | 35 |
35 struct ViewHostMsg_TextInputState_Params; | 36 struct ViewHostMsg_TextInputState_Params; |
36 | 37 |
37 namespace content { | 38 namespace content { |
38 class CompositingIOSurfaceMac; | 39 class CompositingIOSurfaceMac; |
39 class CompositingIOSurfaceContext; | 40 class CompositingIOSurfaceContext; |
40 class RenderWidgetHostViewMac; | 41 class RenderWidgetHostViewMac; |
41 class RenderWidgetHostViewMacEditCommandHelper; | 42 class RenderWidgetHostViewMacEditCommandHelper; |
42 class WebContents; | 43 class WebContents; |
43 } | 44 } |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // If the render process dies, the RenderWidgetHost* goes away and all | 213 // If the render process dies, the RenderWidgetHost* goes away and all |
213 // references to it must become NULL." | 214 // references to it must become NULL." |
214 // | 215 // |
215 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. | 216 // RenderWidgetHostView class hierarchy described in render_widget_host_view.h. |
216 class CONTENT_EXPORT RenderWidgetHostViewMac | 217 class CONTENT_EXPORT RenderWidgetHostViewMac |
217 : public RenderWidgetHostViewBase, | 218 : public RenderWidgetHostViewBase, |
218 public DelegatedFrameHostClient, | 219 public DelegatedFrameHostClient, |
219 public BrowserCompositorViewClient, | 220 public BrowserCompositorViewClient, |
220 public IPC::Sender, | 221 public IPC::Sender, |
221 public SoftwareFrameManagerClient, | 222 public SoftwareFrameManagerClient, |
222 public CompositingIOSurfaceLayerClient { | 223 public CompositingIOSurfaceLayerClient, |
| 224 public gfx::DisplayObserver { |
223 public: | 225 public: |
224 // The view will associate itself with the given widget. The native view must | 226 // The view will associate itself with the given widget. The native view must |
225 // be hooked up immediately to the view hierarchy, or else when it is | 227 // be hooked up immediately to the view hierarchy, or else when it is |
226 // deleted it will delete this out from under the caller. | 228 // deleted it will delete this out from under the caller. |
227 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); | 229 explicit RenderWidgetHostViewMac(RenderWidgetHost* widget); |
228 virtual ~RenderWidgetHostViewMac(); | 230 virtual ~RenderWidgetHostViewMac(); |
229 | 231 |
230 RenderWidgetHostViewCocoa* cocoa_view() const { return cocoa_view_; } | 232 RenderWidgetHostViewCocoa* cocoa_view() const { return cocoa_view_; } |
231 | 233 |
232 // |delegate| is used to separate out the logic from the NSResponder delegate. | 234 // |delegate| is used to separate out the logic from the NSResponder delegate. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 // SoftwareFrameManagerClient implementation: | 344 // SoftwareFrameManagerClient implementation: |
343 virtual void SoftwareFrameWasFreed( | 345 virtual void SoftwareFrameWasFreed( |
344 uint32 output_surface_id, unsigned frame_id) OVERRIDE; | 346 uint32 output_surface_id, unsigned frame_id) OVERRIDE; |
345 virtual void ReleaseReferencesToSoftwareFrame() OVERRIDE; | 347 virtual void ReleaseReferencesToSoftwareFrame() OVERRIDE; |
346 | 348 |
347 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; | 349 virtual SkBitmap::Config PreferredReadbackFormat() OVERRIDE; |
348 | 350 |
349 // CompositingIOSurfaceLayerClient implementation. | 351 // CompositingIOSurfaceLayerClient implementation. |
350 virtual void AcceleratedLayerDidDrawFrame(bool succeeded) OVERRIDE; | 352 virtual void AcceleratedLayerDidDrawFrame(bool succeeded) OVERRIDE; |
351 | 353 |
| 354 // gfx::DisplayObserver implementation. |
| 355 virtual void OnDisplayAdded(const gfx::Display& new_display) OVERRIDE; |
| 356 virtual void OnDisplayRemoved(const gfx::Display& old_display) OVERRIDE; |
| 357 virtual void OnDisplayMetricsChanged(const gfx::Display& display, |
| 358 uint32_t metrics) OVERRIDE; |
| 359 |
352 // Forwards the mouse event to the renderer. | 360 // Forwards the mouse event to the renderer. |
353 void ForwardMouseEvent(const blink::WebMouseEvent& event); | 361 void ForwardMouseEvent(const blink::WebMouseEvent& event); |
354 | 362 |
355 void KillSelf(); | 363 void KillSelf(); |
356 | 364 |
357 void SetTextInputActive(bool active); | 365 void SetTextInputActive(bool active); |
358 | 366 |
359 // Sends completed plugin IME notification and text back to the renderer. | 367 // Sends completed plugin IME notification and text back to the renderer. |
360 void PluginImeCompositionCompleted(const base::string16& text, int plugin_id); | 368 void PluginImeCompositionCompleted(const base::string16& text, int plugin_id); |
361 | 369 |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; | 632 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; |
625 | 633 |
626 base::WeakPtrFactory<RenderWidgetHostViewMac> | 634 base::WeakPtrFactory<RenderWidgetHostViewMac> |
627 software_frame_weak_ptr_factory_; | 635 software_frame_weak_ptr_factory_; |
628 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); | 636 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); |
629 }; | 637 }; |
630 | 638 |
631 } // namespace content | 639 } // namespace content |
632 | 640 |
633 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ | 641 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ |
OLD | NEW |