// Copyright (c) 2010 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 CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_H_ #pragma once #if defined(OS_MACOSX) #include #endif #include #include #include "app/surface/transport_dib.h" #include "base/process_util.h" #include "gfx/native_widget_types.h" #include "gfx/rect.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkColor.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupType.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebTextInputType.h" namespace gfx { class Rect; class Size; } namespace IPC { class Message; } class BackingStore; class RenderProcessHost; class RenderWidgetHost; class WebCursor; struct NativeWebKeyboardEvent; struct ViewHostMsg_AccessibilityNotification_Params; namespace webkit_glue { struct WebAccessibility; } namespace webkit { namespace npapi { struct WebPluginGeometry; } } // RenderWidgetHostView is an interface implemented by an object that acts as // the "View" portion of a RenderWidgetHost. The RenderWidgetHost and its // associated RenderProcessHost own the "Model" in this case which is the // child renderer process. The View is responsible for receiving events from // the surrounding environment and passing them to the RenderWidgetHost, and // for actually displaying the content of the RenderWidgetHost when it // changes. class RenderWidgetHostView { public: virtual ~RenderWidgetHostView(); // Platform-specific creator. Use this to construct new RenderWidgetHostViews // rather than using RenderWidgetHostViewWin & friends. // // This function must NOT size it, because the RenderView in the renderer // wounldn't have been created yet. The widget would set its "waiting for // resize ack" flag, and the ack would never come becasue no RenderView // received it. // // The RenderWidgetHost must already be created (because we can't know if it's // going to be a regular RenderWidgetHost or a RenderViewHost (a subclass). static RenderWidgetHostView* CreateViewForWidget(RenderWidgetHost* widget); // Retrieves the RenderWidgetHostView corresponding to the specified // |native_view|, or NULL if there is no such instance. static RenderWidgetHostView* GetRenderWidgetHostViewFromNativeView( gfx::NativeView native_view); // Perform all the initialization steps necessary for this object to represent // a popup (such as a