blob: 4f8c0ba23745132d6b8d57523d79bc5b693a7a68 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_PLUGIN_VIEW_MAC_H
#define CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_PLUGIN_VIEW_MAC_H
#import <Cocoa/Cocoa.h>
#include <QuartzCore/QuartzCore.h>
#include "base/memory/scoped_nsobject.h"
#include "ui/gfx/native_widget_types.h"
class RenderWidgetHostViewMac;
// Informal protocol implemented by windows that need to be informed explicitly
// about underlay surfaces.
@interface NSObject (UnderlayableSurface)
- (void)underlaySurfaceAdded;
- (void)underlaySurfaceRemoved;
@end
// This subclass of NSView hosts the output of accelerated plugins on
// the page.
@interface AcceleratedPluginView : NSView {
scoped_nsobject<NSOpenGLPixelFormat> glPixelFormat_;
CGLPixelFormatObj cglPixelFormat_; // weak, backed by |glPixelFormat_|.
scoped_nsobject<NSOpenGLContext> glContext_;
CGLContextObj cglContext_; // weak, backed by |glContext_|.
RenderWidgetHostViewMac* renderWidgetHostView_; // weak
gfx::PluginWindowHandle pluginHandle_; // weak
// Rects that should show web content rather than plugin content.
scoped_nsobject<NSArray> cutoutRects_;
BOOL handlingGlobalFrameDidChange_;
}
- (id)initWithRenderWidgetHostViewMac:(RenderWidgetHostViewMac*)r
pluginHandle:(gfx::PluginWindowHandle)pluginHandle;
// Sets the list of rectangles that should show the web page, rather than the
// accelerated plugin. This is used to simulate the iframe-based trick that web
// pages have long used to show web content above windowed plugins on Windows
// and Linux.
- (void)setCutoutRects:(NSArray*)cutout_rects;
// NSViews autorelease subviews when they die. The RWHVMac gets destroyed when
// RHWVCocoa gets dealloc'd, which means the AcceleratedPluginView child views
// can be around a little longer than the RWHVMac. This is called when the
// RWHVMac is about to be deleted (but it's still valid while this method runs).
- (void)onRenderWidgetHostViewGone;
// Draw the view from the UI thread.
- (void)drawView;
@end
#endif // CONTENT_BROWSER_RENDERER_HOST_ACCELERATED_PLUGIN_VIEW_MAC_H
|