Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(793)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.h

Issue 341983008: Listen to Display reconfiguration and notify DisplayObservers on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mac_display
Patch Set: review comments + tests Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 BrowserCompositorviewMac; 39 class BrowserCompositorviewMac;
39 class CompositingIOSurfaceMac; 40 class CompositingIOSurfaceMac;
40 class CompositingIOSurfaceContext; 41 class CompositingIOSurfaceContext;
41 class RenderWidgetHostViewMac; 42 class RenderWidgetHostViewMac;
42 class RenderWidgetHostViewMacEditCommandHelper; 43 class RenderWidgetHostViewMacEditCommandHelper;
43 class WebContents; 44 class WebContents;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 BrowserCompositorViewMacClient, 220 public BrowserCompositorViewMacClient,
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
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 SkColorType PreferredReadbackFormat() OVERRIDE; 349 virtual SkColorType 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_; 647 scoped_ptr<RenderWidgetHostViewFrameSubscriber> frame_subscriber_;
640 648
641 base::WeakPtrFactory<RenderWidgetHostViewMac> 649 base::WeakPtrFactory<RenderWidgetHostViewMac>
642 software_frame_weak_ptr_factory_; 650 software_frame_weak_ptr_factory_;
643 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac); 651 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewMac);
644 }; 652 };
645 653
646 } // namespace content 654 } // namespace content
647 655
648 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_ 656 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_MAC_H_
OLDNEW
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | ui/gfx/display_change_notifier.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698