15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved. 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file. 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#ifndef CONTENT_RENDERER_RENDER_WIDGET_H_ 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#define CONTENT_RENDERER_RENDER_WIDGET_H_ 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <deque> 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include <map> 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/basictypes.h" 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/compiler_specific.h" 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/ref_counted.h" 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "base/memory/scoped_ptr.h" 15eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "base/time/time.h" 16eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch#include "base/timer/timer.h" 17424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)#include "cc/debug/rendering_stats_instrumentation.h" 18868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "content/common/browser_rendering_stats.h" 195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/common/content_export.h" 202a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 21f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)#include "content/common/input/synthetic_gesture_params.h" 225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "content/renderer/paint_aggregator.h" 235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_listener.h" 245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ipc/ipc_sender.h" 25868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "third_party/WebKit/public/platform/WebRect.h" 267d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "third_party/WebKit/public/web/WebCompositionUnderline.h" 277d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "third_party/WebKit/public/web/WebPopupType.h" 287d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "third_party/WebKit/public/web/WebTextDirection.h" 297d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "third_party/WebKit/public/web/WebTextInputInfo.h" 30a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#include "third_party/WebKit/public/web/WebTouchAction.h" 317dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "third_party/WebKit/public/web/WebWidget.h" 327d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#include "third_party/WebKit/public/web/WebWidgetClient.h" 335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "third_party/skia/include/core/SkBitmap.h" 347dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#include "ui/base/ime/text_input_mode.h" 355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/base/ime/text_input_type.h" 365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/native_widget_types.h" 3758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#include "ui/gfx/range/range.h" 385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/gfx/rect.h" 392a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#include "ui/gfx/vector2d.h" 4090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "ui/gfx/vector2d_f.h" 415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "ui/surface/transport_dib.h" 42868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "webkit/common/cursors/webcursor.h" 435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)struct ViewHostMsg_UpdateRect_Params; 4590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)struct ViewMsg_Resize_Params; 465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class ViewHostMsg_UpdateRect; 475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace IPC { 495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class SyncMessage; 505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 52f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)namespace blink { 535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class WebGestureEvent; 542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class WebInputEvent; 557d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)class WebKeyboardEvent; 565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class WebMouseEvent; 575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class WebTouchEvent; 582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)struct WebRenderingStatsImpl; 595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 612a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)namespace cc { class OutputSurface; } 625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)namespace gfx { 645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class Range; 655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)namespace content { 684e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)class ExternalPopupMenu; 6958e6fbe4ee35d65e14b626c557d37565bf8ad179Ben Murdochclass PepperPluginInstanceImpl; 702a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)class RenderWidgetCompositor; 715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class RenderWidgetTest; 721e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)class ResizingModeSelector; 734e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)struct ContextMenuParams; 74ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdochstruct GpuRenderingStats; 75ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdochstruct WebPluginGeometry; 765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// RenderWidget provides a communication bridge between a WebWidget and 785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// a RenderWidgetHost, the latter of which lives in a different process. 795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)class CONTENT_EXPORT RenderWidget 805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) : public IPC::Listener, 815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public IPC::Sender, 82f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) NON_EXPORTED_BASE(virtual public blink::WebWidgetClient), 835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public base::RefCounted<RenderWidget> { 845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) public: 855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Creates a new RenderWidget. The opener_id is the routing ID of the 865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // RenderView that this widget lives inside. 875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) static RenderWidget* Create(int32 opener_id, 88f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebPopupType popup_type, 89f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) const blink::WebScreenInfo& screen_info); 905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Creates a WebWidget based on the popup type. 92f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) static blink::WebWidget* CreateWebWidget(RenderWidget* render_widget); 935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // The compositing surface assigned by the RenderWidgetHost 955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // (or RenderViewHost). Will be gfx::kNullPluginWindow if not assigned yet, 965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // in which case we should not create any GPU command buffers with it. 975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // The routing ID assigned by the RenderProcess. Will be MSG_ROUTING_NONE if 985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // not yet assigned a view ID, in which case, the process MUST NOT send 995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // messages with this ID to the parent. 1005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 routing_id() const { 1015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return routing_id_; 1025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 1035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 surface_id() const { 1055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return surface_id_; 1065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 1075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // May return NULL when the window is closing. 109f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebWidget* webwidget() const { return webwidget_; } 1105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Size size() const { return size_; } 1125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool has_focus() const { return has_focus_; } 1135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool is_fullscreen() const { return is_fullscreen_; } 1145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool is_hidden() const { return is_hidden_; } 1155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // IPC::Listener 1175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 1185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // IPC::Sender 1205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual bool Send(IPC::Message* msg) OVERRIDE; 1215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 122f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // blink::WebWidgetClient 1232a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void suppressCompositorScheduling(bool enable); 1245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void willBeginCompositorFrame(); 125f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual void didInvalidateRect(const blink::WebRect&); 1262a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void didScrollRect(int dx, int dy, 127f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) const blink::WebRect& clipRect); 128f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual void didAutoResize(const blink::WebSize& new_size); 1295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void didActivateCompositor(int input_handler_identifier); 1305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void didDeactivateCompositor(); 1312a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void initializeLayerTreeView(); 132f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual blink::WebLayerTreeView* layerTreeView(); 1335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void didBecomeReadyForAdditionalInput(); 1345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void didCommitAndDrawCompositorFrame(); 1355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void didCompleteSwapBuffers(); 1365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void scheduleComposite(); 1375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void scheduleAnimation(); 1385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void didFocus(); 1395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void didBlur(); 140f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual void didChangeCursor(const blink::WebCursorInfo&); 1415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void closeWidgetSoon(); 142f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual void show(blink::WebNavigationPolicy); 1435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void runModal() {} 144f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual blink::WebRect windowRect(); 145f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual void setToolTipText(const blink::WebString& text, 146f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebTextDirection hint); 147f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual void setWindowRect(const blink::WebRect&); 148f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual blink::WebRect windowResizerRect(); 149f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual blink::WebRect rootWindowRect(); 150f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual blink::WebScreenInfo screenInfo(); 1515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual float deviceScaleFactor(); 1525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void resetInputMethod(); 153f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual void didHandleGestureEvent(const blink::WebGestureEvent& event, 1542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) bool event_cancelled); 1555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Called when a plugin is moved. These events are queued up and sent with 1575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // the next paint or scroll message to the host. 158ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch void SchedulePluginMove(const WebPluginGeometry& move); 1595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Called when a plugin window has been destroyed, to make sure the currently 1615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // pending moves don't try to reference it. 1625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void CleanupWindowInPluginMoves(gfx::PluginWindowHandle window); 1635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Fills in a WebRenderingStatsImpl struct containing information about 1655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // rendering, e.g. count of frames rendered, time spent painting. 166f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) void GetRenderingStats(blink::WebRenderingStatsImpl&) const; 1675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Fills in a GpuRenderingStats struct containing information about 1695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // GPU rendering, e.g. count of texture uploads performed, time spent 1705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // uploading. 1715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // This call is relatively expensive as it blocks on the GPU process 1725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool GetGpuRenderingStats(GpuRenderingStats*) const; 1735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 174868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) void GetBrowserRenderingStats(BrowserRenderingStats* stats); 175868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 176c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) RenderWidgetCompositor* compositor() const; 177c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 178a36e5920737c6adbddd3e43b760e5de8431db6e0Torne (Richard Coles) virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(bool fallback); 1792a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 180424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) // Callback for use with synthetic gestures (e.g. BeginSmoothScroll). 181424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) typedef base::Callback<void()> SyntheticGestureCompletionCallback; 1825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 183f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // Send a synthetic gesture to the browser to be queued to the synthetic 184f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // gesture controller. 185f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) void QueueSyntheticGesture( 186f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) scoped_ptr<SyntheticGestureParams> gesture_params, 187f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) const SyntheticGestureCompletionCallback& callback); 18858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 1895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Close the underlying WebWidget. 1905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void Close(); 1915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 1922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Notifies about a compositor frame commit operation having finished. 1932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void DidCommitCompositorFrame(); 1942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 1955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) float filtered_time_per_frame() const { 1965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) return filtered_time_per_frame_; 1975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) } 1985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 19990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) // Handle common setup/teardown for handling IME events. 20090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) void StartHandlingImeEvent(); 20190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) void FinishHandlingImeEvent(); 20290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) 203f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual void InstrumentWillBeginFrame(int frame_id) {} 2042a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void InstrumentDidBeginFrame() {} 2052a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void InstrumentDidCancelFrame() {} 2062a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void InstrumentWillComposite() {} 2072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 2082a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual bool AllowPartialSwap() const; 20990dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) bool UsingSynchronousRendererCompositor() const; 2102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 211eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch bool is_swapped_out() { return is_swapped_out_; } 212eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch 2134e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // ScreenMetricsEmulator class manages screen emulation inside a render 2144e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // widget. This includes resizing, placing view on the screen at desired 2154e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // position, changing device scale factor, and scaling down the whole 2164e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // widget if required to fit into the browser window. 2174e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) class ScreenMetricsEmulator; 2184e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 2194e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // Emulates screen and widget metrics. Supplied values override everything 2204e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // coming from host. 2214e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) void EnableScreenMetricsEmulation( 222f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) const gfx::Rect& device_rect, 2234e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) const gfx::Rect& widget_rect, 2244e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) float device_scale_factor, 2254e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) bool fit_to_view); 2264e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) void DisableScreenMetricsEmulation(); 2274e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) void SetPopupOriginAdjustmentsForEmulation(ScreenMetricsEmulator* emulator); 2284e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 2294e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) void ScheduleCompositeWithForcedRedraw(); 2304e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 231f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // Called by the compositor in single-threaded mode when a swap is posted, 232f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // completes or is aborted. 233f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) void OnSwapBuffersPosted(); 234f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) void OnSwapBuffersComplete(); 235f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) void OnSwapBuffersAborted(); 236f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) 237a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) // Checks if the text input state and compose inline mode have been changed. 238a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) // If they are changed, the new value will be sent to the browser process. 239a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) void UpdateTextInputType(); 240a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 241a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) // Checks if the selection bounds have been changed. If they are changed, 242a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) // the new value will be sent to the browser process. 243a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) void UpdateSelectionBounds(); 244a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 245a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 246a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA) 247a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) // Checks if the composition range or composition character bounds have been 248a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) // changed. If they are changed, the new value will be sent to the browser 249a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) // process. 250a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) void UpdateCompositionInfo(bool should_update_range); 251a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles)#endif 252a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 2535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) protected: 2545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Friend RefCounted so that the dtor can be non-public. Using this class 2555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // without ref-counting is an error. 2565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) friend class base::RefCounted<RenderWidget>; 2575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // For unit tests. 2585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) friend class RenderWidgetTest; 2595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) enum ResizeAck { 2615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) SEND_RESIZE_ACK, 2625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) NO_RESIZE_ACK, 2635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) }; 2645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 265f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) RenderWidget(blink::WebPopupType popup_type, 266f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) const blink::WebScreenInfo& screen_info, 2673551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) bool swapped_out, 2683551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) bool hidden); 2695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual ~RenderWidget(); 2715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Initializes this view with the given opener. CompleteInit must be called 2735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // later. 2742a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) bool Init(int32 opener_id); 2755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Called by Init and subclasses to perform initialization. 2772a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) bool DoInit(int32 opener_id, 278f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebWidget* web_widget, 2795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) IPC::SyncMessage* create_widget_message); 2805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Finishes creation of a pending view started with Init. 2825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void CompleteInit(); 2835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Sets whether this RenderWidget has been swapped out to be displayed by 2855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // a RenderWidget in a different process. If so, no new IPC messages will be 2865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // sent (only ACKs) and the process is free to exit when there are no other 2875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // active RenderWidgets. 2885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void SetSwappedOut(bool is_swapped_out); 2895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Paints the given rectangular region of the WebWidget into canvas (a 2915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // shared memory segment returned by AllocPaintBuf on Windows). The caller 2925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // must ensure that the given rect fits within the bounds of the WebWidget. 2935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void PaintRect(const gfx::Rect& rect, const gfx::Point& canvas_origin, 2942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) SkCanvas* canvas); 2955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Paints a border at the given rect for debugging purposes. 2972a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) void PaintDebugBorder(const gfx::Rect& rect, SkCanvas* canvas); 2985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 2995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool IsRenderingVSynced(); 3005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void AnimationCallback(); 3015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void AnimateIfNeeded(); 3025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void InvalidationCallback(); 3031e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) void FlushPendingInputEventAck(); 3045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void DoDeferredUpdateAndSendInputAck(); 3055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void DoDeferredUpdate(); 3065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void DoDeferredClose(); 307f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) void DoDeferredSetWindowRect(const blink::WebRect& pos); 3082a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void Composite(base::TimeTicks frame_begin_time); 3095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Set the background of the render widget to a bitmap. The bitmap will be 3115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // tiled in both directions if it isn't big enough to fill the area. This is 3125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // mainly intended to be used in conjuction with WebView::SetIsTransparent(). 3135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void SetBackground(const SkBitmap& bitmap); 3145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Resizes the render widget. 3165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void Resize(const gfx::Size& new_size, 3172a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const gfx::Size& physical_backing_size, 3182a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) float overdraw_bottom_height, 3195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) const gfx::Rect& resizer_rect, 3205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool is_fullscreen, 3215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) ResizeAck resize_ack); 3221e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) // Used to force the size of a window when running layout tests. 3231e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) void ResizeSynchronously(const gfx::Rect& new_position); 3244e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) virtual void SetScreenMetricsEmulationParameters( 325f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) float device_scale_factor, 326f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) const gfx::Point& root_layer_offset, 327f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) float root_layer_scale); 3284e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) void SetExternalPopupOriginAdjustmentsForEmulation( 3294e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) ExternalPopupMenu* popup, ScreenMetricsEmulator* emulator); 3304e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) virtual void OnShowHostContextMenu(ContextMenuParams* params); 3315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // RenderWidget IPC message handlers 333f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) void OnHandleInputEvent(const blink::WebInputEvent* event, 334a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) ui::LatencyInfo latency_info, 335c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) bool keyboard_shortcut); 336c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) void OnCursorVisibilityChange(bool is_visible); 337c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) void OnMouseCaptureLost(); 338c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) virtual void OnSetFocus(bool enable); 3395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void OnClose(); 3405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void OnCreatingNewAck(); 34190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles) virtual void OnResize(const ViewMsg_Resize_Params& params); 3425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void OnChangeResizeRect(const gfx::Rect& resizer_rect); 3435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void OnWasHidden(); 3445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void OnWasShown(bool needs_repainting); 3455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void OnWasSwappedOut(); 3465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void OnUpdateRectAck(); 3475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void OnCreateVideoAck(int32 video_id); 3485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void OnUpdateVideoAck(int32 video_id); 3495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void OnRequestMoveAck(); 3505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void OnSetInputMethodActive(bool is_active); 351a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) void OnCandidateWindowShown(); 352a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) void OnCandidateWindowUpdated(); 353a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) void OnCandidateWindowHidden(); 3545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void OnImeSetComposition( 355a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) const base::string16& text, 356f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) const std::vector<blink::WebCompositionUnderline>& underlines, 3575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int selection_start, 3585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int selection_end); 359a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) virtual void OnImeConfirmComposition(const base::string16& text, 36058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) const gfx::Range& replacement_range, 3617dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch bool keep_selection); 3622a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) void OnPaintAtSize(const TransportDIB::Handle& dib_id, 3632a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) int tag, 3642a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const gfx::Size& page_size, 3652a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) const gfx::Size& desired_size); 366c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) void OnRepaint(gfx::Size size_to_paint); 367424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) void OnSyntheticGestureCompleted(); 368f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) void OnSetTextDirection(blink::WebTextDirection direction); 3695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void OnGetFPS(); 3705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void OnUpdateScreenRects(const gfx::Rect& view_screen_rect, 3715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) const gfx::Rect& window_screen_rect); 3722a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#if defined(OS_ANDROID) 3732a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) void OnShowImeIfNeeded(); 3742385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch 3752385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // Whenever an IME event that needs an acknowledgement is sent to the browser, 3762385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // the number of outstanding IME events that needs acknowledgement should be 3772385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // incremented. All IME events will be dropped until we receive an ack from 3782385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // the browser. 3792385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch void IncrementOutstandingImeEventAcks(); 3802385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch 3812385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // Called by the browser process for every required IME acknowledgement. 3822385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch void OnImeEventAck(); 3832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles)#endif 3842385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // Returns whether we currently should handle an IME event. 3852385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch bool ShouldHandleImeEvent(); 3862385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch 3872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) void OnSnapshot(const gfx::Rect& src_subrect); 388868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) void OnSetBrowserRenderingStats(const BrowserRenderingStats& stats); 3892a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 3902a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Notify the compositor about a change in viewport size. This should be 3912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // used only with auto resize mode WebWidgets, as normal WebWidgets should 3922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // go through OnResize. 3932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) void AutoResizeCompositor(); 3942a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 3952a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual void SetDeviceScaleFactor(float device_scale_factor); 3965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 3975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Override points to notify derived classes that a paint has happened. 3984e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // DidInitiatePaint happens when that has completed, and subsequent rendering 3994e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // won't affect the painted content. DidFlushPaint happens once we've received 4004e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // the ACK that the screen has been updated. For a given paint operation, 4014e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // these overrides will always be called in the order DidInitiatePaint, 4024e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // DidFlushPaint. 4035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void DidInitiatePaint() {} 4045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void DidFlushPaint() {} 4055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Override and return true when the widget is rendered with a graphics 4075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // context that supports asynchronous swapbuffers. When returning true, the 4085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // subclass must call OnSwapBuffersPosted() when swap is posted, 4095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // OnSwapBuffersComplete() when swaps complete, and OnSwapBuffersAborted if 4105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // the context is lost. 4115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual bool SupportsAsynchronousSwapBuffers(); 4122a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual GURL GetURLForGraphicsContext3D(); 4135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual bool ForceCompositingModeEnabled(); 4155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Detects if a suitable opaque plugin covers the given paint bounds with no 4175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // compositing necessary. 4185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // 4195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Returns the plugin instance that's the source of the paint if the paint 4205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // can be handled by just blitting the plugin bitmap. In this case, the 4215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // location, clipping, and ID of the backing store will be filled into the 4225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // given output parameters. 4235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // 4245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // A return value of null means optimized painting can not be used and we 4255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // should continue with the normal painting code path. 42658e6fbe4ee35d65e14b626c557d37565bf8ad179Ben Murdoch virtual PepperPluginInstanceImpl* GetBitmapForOptimizedPluginPaint( 4275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) const gfx::Rect& paint_bounds, 4285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) TransportDIB** dib, 4295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Rect* location, 4305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Rect* clip, 4315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) float* scale_factor); 4325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Gets the scroll offset of this widget, if this widget has a notion of 4345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // scroll offset. 4355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual gfx::Vector2d GetScrollOffset(); 4365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Sets the "hidden" state of this widget. All accesses to is_hidden_ should 4385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // use this method so that we can properly inform the RenderThread of our 4395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // state. 4405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void SetHidden(bool hidden); 4415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void WillToggleFullscreen(); 4435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void DidToggleFullscreen(); 4445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool next_paint_is_resize_ack() const; 4465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool next_paint_is_restore_ack() const; 4475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void set_next_paint_is_resize_ack(); 4485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void set_next_paint_is_restore_ack(); 4495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void set_next_paint_is_repaint_ack(); 4505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4517d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#if defined(OS_ANDROID) 4522385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // |show_ime_if_needed| should be true iff the update may cause the ime to be 4532385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // displayed, e.g. after a tap on an input field on mobile. 4542385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // |send_ime_ack| should be true iff the browser side is required to 4552385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // acknowledge the change before the renderer handles any more IME events. 4562385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // This is when the event did not originate from the browser side IME, such as 4572385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // changes from JavaScript or autofill. 4582385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch void UpdateTextInputState(bool show_ime_if_needed, bool send_ime_ack); 4597d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles)#endif 4605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Override point to obtain that the current input method state and caret 4625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // position. 4635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual ui::TextInputType GetTextInputType(); 4645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void GetSelectionBounds(gfx::Rect* start, gfx::Rect* end); 4655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual ui::TextInputType WebKitToUiTextInputType( 466f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebTextInputType type); 4675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4687dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#if defined(OS_MACOSX) || defined(OS_WIN) || defined(USE_AURA) 4695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Override point to obtain that the current composition character bounds. 4705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // In the case of surrogate pairs, the character is treated as two characters: 4715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // the bounds for first character is actual one, and the bounds for second 4725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // character is zero width rectangle. 4735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void GetCompositionCharacterBounds( 4745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) std::vector<gfx::Rect>* character_bounds); 4755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 476eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch // Returns the range of the text that is being composed or the selection if 477eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch // the composition does not exist. 47858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) virtual void GetCompositionRange(gfx::Range* range); 479eb525c5499e34cc9c4b825d6d9e75bb07cc06aceBen Murdoch 4805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Returns true if the composition range or composition character bounds 4815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // should be sent to the browser process. 4825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool ShouldUpdateCompositionInfo( 48358537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) const gfx::Range& range, 4845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) const std::vector<gfx::Rect>& bounds); 4857dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch#endif 4865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Override point to obtain that the current input method state about 4885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // composition text. 4895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual bool CanComposeInline(); 4905821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Tells the renderer it does not have focus. Used to prevent us from getting 4925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // the focus on our own when the browser did not focus us. 4935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) void ClearFocus(); 4945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 4955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Set the pending window rect. 4965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Because the real render_widget is hosted in another process, there is 4975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // a time period where we may have set a new window rect which has not yet 4985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // been processed by the browser. So we maintain a pending window rect 4995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // size. If JS code sets the WindowRect, and then immediately calls 5005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // GetWindowRect() we'll use this pending window rect as the size. 501f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) void SetPendingWindowRect(const blink::WebRect& r); 5025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Called by OnHandleInputEvent() to notify subclasses that a key event was 5045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // just handled. 5055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) virtual void DidHandleKeyEvent() {} 5065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Called by OnHandleInputEvent() to notify subclasses that a mouse event is 5085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // about to be handled. 5095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Returns true if no further handling is needed. In that case, the event 5105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // won't be sent to WebKit or trigger DidHandleMouseEvent(). 511f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual bool WillHandleMouseEvent(const blink::WebMouseEvent& event); 5125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5137d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) // Called by OnHandleInputEvent() to notify subclasses that a key event is 5147d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) // about to be handled. 5157d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) // Returns true if no further handling is needed. In that case, the event 5167d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) // won't be sent to WebKit or trigger DidHandleKeyEvent(). 517f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual bool WillHandleKeyEvent(const blink::WebKeyboardEvent& event); 5187d4cd473f85ac64c3747c96c277f9e506a0d2246Torne (Richard Coles) 5195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Called by OnHandleInputEvent() to notify subclasses that a gesture event is 5205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // about to be handled. 5215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Returns true if no further handling is needed. In that case, the event 5225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // won't be sent to WebKit. 523f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual bool WillHandleGestureEvent(const blink::WebGestureEvent& event); 5245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Called by OnHandleInputEvent() to notify subclasses that a mouse event was 5265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // just handled. 527f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual void DidHandleMouseEvent(const blink::WebMouseEvent& event) {} 5285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Called by OnHandleInputEvent() to notify subclasses that a touch event was 5305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // just handled. 531f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) virtual void DidHandleTouchEvent(const blink::WebTouchEvent& event) {} 5325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5332a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Check whether the WebWidget has any touch event handlers registered 5342a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // at the given point. 5352a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) virtual bool HasTouchEventHandlersAt(const gfx::Point& point) const; 5362a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 537c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) // Check whether the WebWidget has any touch event handlers registered. 538c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) virtual void hasTouchEventHandlers(bool has_handlers); 539c2e0dbddbe15c98d52c4786dac06cb8952a8ae6dTorne (Richard Coles) 540a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) // Tell the browser about the actions permitted for a new touch point. 541a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) virtual void setTouchAction(blink::WebTouchAction touch_action); 542a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 5432a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Creates a 3D context associated with this view. 5443551c9c881056c480085172ff9840cab31610854Torne (Richard Coles) scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateGraphicsContext3D( 545f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) const blink::WebGraphicsContext3D::Attributes& attributes); 5462a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 5472a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) bool OnSnapshotHelper(const gfx::Rect& src_subrect, SkBitmap* bitmap); 5485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Routing ID that allows us to communicate to the parent browser process 5505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // RenderWidgetHost. When MSG_ROUTING_NONE, no messages may be sent. 5515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 routing_id_; 5525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 surface_id_; 5545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // We are responsible for destroying this object via its Close method. 556f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebWidget* webwidget_; 5575821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5582a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // This is lazily constructed and must not outlive webwidget_. 5592a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) scoped_ptr<RenderWidgetCompositor> compositor_; 5602a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 5615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Set to the ID of the view that initiated creating this view, if any. When 5625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // the view was initiated by the browser (the common case), this will be 5635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // MSG_ROUTING_NONE. This is used in determining ownership when opening 5645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // child tabs. See RenderWidget::createWebViewWithRequest. 5655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // 5665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // This ID may refer to an invalid view if that view is closed before this 5675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // view is. 5685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int32 opener_id_; 5695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // The position where this view should be initially shown. 5715821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Rect initial_pos_; 5725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool init_complete_; 5745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // We store the current cursor object so we can avoid spamming SetCursor 5765821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // messages. 5775821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) WebCursor current_cursor_; 5785821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5795821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // The size of the RenderWidget. 5805821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Size size_; 5815821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // The TransportDIB that is being used to transfer an image to the browser. 5835821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) TransportDIB* current_paint_buf_; 5845821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) PaintAggregator paint_aggregator_; 5865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5872a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // The size of the view's backing surface in non-DPI-adjusted pixels. 5882a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) gfx::Size physical_backing_size_; 5892a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 5902a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // The height of the physical backing surface that is overdrawn opaquely in 5912a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // the browser, for example by an on-screen-keyboard (in DPI-adjusted pixels). 5922a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) float overdraw_bottom_height_; 5932a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 5945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // The area that must be reserved for drawing the resize corner. 5955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Rect resizer_rect_; 5965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 5975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Flags for the next ViewHostMsg_UpdateRect message. 5985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int next_paint_flags_; 5995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Filtered time per frame based on UpdateRect messages. 6015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) float filtered_time_per_frame_; 6025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // True if we are expecting an UpdateRect_ACK message (i.e., that a 6045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // UpdateRect message has been sent). 6055821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool update_reply_pending_; 6065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6072a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Whether the WebWidget is in auto resize mode, which is used for example 6082a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // by extension popups. 6092a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) bool auto_resize_mode_; 6102a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 6115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // True if we need to send an UpdateRect message to notify the browser about 6125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // an already-completed auto-resize. 6135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool need_update_rect_for_auto_resize_; 6145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // True if the underlying graphics context supports asynchronous swap. 6165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Cached on the RenderWidget because determining support is costly. 6175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool using_asynchronous_swapbuffers_; 6185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Number of OnSwapBuffersComplete we are expecting. Incremented each time 6205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // WebWidget::composite has been been performed when the RenderWidget subclass 6215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // SupportsAsynchronousSwapBuffers. Decremented in OnSwapBuffers. Will block 6225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // rendering. 6235821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int num_swapbuffers_complete_pending_; 6245821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6255821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // When accelerated rendering is on, is the maximum number of swapbuffers that 6265821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // can be outstanding before we start throttling based on 6275821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // OnSwapBuffersComplete callback. 6285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) static const int kMaxSwapBuffersPending = 2; 6295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Set to true if we should ignore RenderWidget::Show calls. 6315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool did_show_; 6325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Indicates that we shouldn't bother generated paint events. 6345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool is_hidden_; 6355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6365821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Indicates that we are in fullscreen mode. 6375821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool is_fullscreen_; 6385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Indicates that we should be repainted when restored. This flag is set to 6405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // true if we receive an invalidation / scroll event from webkit while our 6415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // is_hidden_ flag is set to true. This is used to force a repaint once we 6425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // restore to account for the fact that our host would not know about the 6435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // invalidation / scroll event(s) from webkit while we are hidden. 6445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool needs_repainting_on_restore_; 6455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Indicates whether we have been focused/unfocused by the browser. 6475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool has_focus_; 6485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Are we currently handling an input event? 6505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool handling_input_event_; 6515821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6522a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) // Are we currently handling an ime event? 6532a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) bool handling_ime_event_; 6542a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) 655a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) // Are we currently handling a touchstart event? 656a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) bool handling_touchstart_event_; 657a3f6a49ab37290eeeb8db0f41ec0f1cb74a68be7Torne (Richard Coles) 6585821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // True if we have requested this widget be closed. No more messages will 6595821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // be sent, except for a Close. 6605821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool closing_; 6615821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Whether this RenderWidget is currently swapped out, such that the view is 6635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // being rendered by another process. If all RenderWidgets in a process are 6645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // swapped out, the process can exit. 6655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool is_swapped_out_; 6665821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6675821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Indicates if an input method is active in the browser process. 6685821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool input_method_is_active_; 6695821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6705821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Stores information about the current text input. 671f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebTextInputInfo text_input_info_; 6725821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6735821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Stores the current text input type of |webwidget_|. 6745821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) ui::TextInputType text_input_type_; 6755821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6767dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch // Stores the current text input mode of |webwidget_|. 6777dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch ui::TextInputMode text_input_mode_; 6787dbb3d5cf0c15f500944d211057644d6a2f37371Ben Murdoch 67958537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) // Stores the current type of composition text rendering of |webwidget_|. 68058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) bool can_compose_inline_; 68158537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) 6825821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Stores the current selection bounds. 6832a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) gfx::Rect selection_focus_rect_; 6842a99a7e74a7f215066514fe81d2bfa6639d9edddTorne (Richard Coles) gfx::Rect selection_anchor_rect_; 6855821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6865821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Stores the current composition character bounds. 6875821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) std::vector<gfx::Rect> composition_character_bounds_; 6885821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6895821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Stores the current composition range. 69058537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) gfx::Range composition_range_; 6915821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6925821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // The kind of popup this widget represents, NONE if not a popup. 693f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebPopupType popup_type_; 6945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Holds all the needed plugin window moves for a scroll. 696ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch typedef std::vector<WebPluginGeometry> WebPluginGeometryVector; 6975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) WebPluginGeometryVector plugin_window_moves_; 6985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 6995821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // A custom background for the widget. 7005821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) SkBitmap background_; 7015821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7025821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // While we are waiting for the browser to update window sizes, we track the 7035821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // pending size temporarily. 7045821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) int pending_window_rect_count_; 705f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebRect pending_window_rect_; 7065821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7075821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // The screen rects of the view and the window that contains it. 7085821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Rect view_screen_rect_; 7095821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) gfx::Rect window_screen_rect_; 7105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) scoped_ptr<IPC::Message> pending_input_event_ack_; 7125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7131e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) // The time spent in input handlers this frame. Used to throttle input acks. 7141e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) base::TimeDelta total_input_handling_time_this_frame_; 7151e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 7165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Indicates if the next sequence of Char events should be suppressed or not. 7175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool suppress_next_char_events_; 7185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7195821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Set to true if painting to the window is handled by the accelerated 7205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // compositor. 7215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool is_accelerated_compositing_active_; 7225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 72368043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) // Set to true if compositing has ever been active for this widget. Once a 72468043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) // widget has used compositing, it will act as though force compositing mode 72568043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) // is on for the remainder of the widget's lifetime. 72668043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) bool was_accelerated_compositing_ever_active_; 72768043e1e95eeb07d5cae7aca370b26518b0867d6Torne (Richard Coles) 7285821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) base::OneShotTimer<RenderWidget> animation_timer_; 7295821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) base::Time animation_floor_time_; 7305821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool animation_update_pending_; 7315821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool invalidation_task_posted_; 7325821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7335821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool has_disable_gpu_vsync_switch_; 7345821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) base::TimeTicks last_do_deferred_update_time_; 7355821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 736424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) // Stats for legacy software mode 737424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) scoped_ptr<cc::RenderingStatsInstrumentation> legacy_software_mode_stats_; 7385821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7395821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // UpdateRect parameters for the current compositing pass. This is used to 7405821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // pass state between DoDeferredUpdate and OnSwapBuffersPosted. 7415821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) scoped_ptr<ViewHostMsg_UpdateRect_Params> pending_update_params_; 7425821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7435821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Queue of UpdateRect messages corresponding to a SwapBuffers. We want to 7445821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // delay sending of UpdateRect until the corresponding SwapBuffers has been 7455821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // executed. Since we can have several in flight, we need to keep them in a 7465821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // queue. Note: some SwapBuffers may not correspond to an update, in which 7475821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // case NULL is added to the queue. 7485821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) std::deque<ViewHostMsg_UpdateRect*> updates_pending_swap_; 7495821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7505821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Properties of the screen hosting this RenderWidget instance. 751f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) blink::WebScreenInfo screen_info_; 7525821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7535821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // The device scale factor. This value is computed from the DPI entries in 7545821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // |screen_info_| on some platforms, and defaults to 1 on other platforms. 7555821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) float device_scale_factor_; 7565821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 757f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // State associated with synthetic gestures. Synthetic gestures are processed 758f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // in-order, so a queue is sufficient to identify the correct state for a 759f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) // completed gesture. 760f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) std::queue<SyntheticGestureCompletionCallback> 761f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles) pending_synthetic_gesture_callbacks_; 7625821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7635821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // Specified whether the compositor will run in its own thread. 7645821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) bool is_threaded_compositing_enabled_; 7655821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 766868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // The last set of rendering stats received from the browser. This is only 767868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // received when using the --enable-gpu-benchmarking flag. 768868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) BrowserRenderingStats browser_rendering_stats_; 769868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 770868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // The latency information for any current non-accelerated-compositing 771868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) // frame. 772868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) ui::LatencyInfo latency_info_; 773868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles) 774ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch uint32 next_output_surface_id_; 775ca12bfac764ba476d6cd062bf1dde12cc64c3f40Ben Murdoch 7762385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch#if defined(OS_ANDROID) 7772385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // A counter for number of outstanding messages from the renderer to the 7782385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // browser regarding IME-type events that have not been acknowledged by the 7792385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch // browser. If this value is not 0 IME events will be dropped. 7802385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch int outstanding_ime_acks_; 7812385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch#endif 7822385ea399aae016c0806a4f9ef3c9cfe3d2a39dfBen Murdoch 7834e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) scoped_ptr<ScreenMetricsEmulator> screen_metrics_emulator_; 7844e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 7854e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // Popups may be displaced when screen metrics emulation is enabled. 7864e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) // These values are used to properly adjust popup position. 7874e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) gfx::Point popup_view_origin_for_emulation_; 7884e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) gfx::Point popup_screen_origin_for_emulation_; 7894e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) float popup_origin_scale_for_emulation_; 7904e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 7911e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) scoped_ptr<ResizingModeSelector> resizing_mode_selector_; 7921e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 7935821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(RenderWidget); 7945821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}; 7955821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7965821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} // namespace content 7975821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 7985821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#endif // CONTENT_RENDERER_RENDER_WIDGET_H_ 799