// Copyright (c) 2012 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 #include #include "base/memory/scoped_nsobject.h" #include "ui/gfx/native_widget_types.h" namespace content { class RenderWidgetHostViewMac; } // This subclass of NSView hosts the output of accelerated plugins on // the page. @interface AcceleratedPluginView : NSView { scoped_nsobject glPixelFormat_; CGLPixelFormatObj cglPixelFormat_; // weak, backed by |glPixelFormat_|. scoped_nsobject glContext_; CGLContextObj cglContext_; // weak, backed by |glContext_|. content::RenderWidgetHostViewMac* renderWidgetHostView_; // weak gfx::PluginWindowHandle pluginHandle_; // weak // Rects that should show web content rather than plugin content. scoped_nsobject cutoutRects_; BOOL handlingGlobalFrameDidChange_; } - (id)initWithRenderWidgetHostViewMac:(content::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