#include "ui/base/ime/text_input_client.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/compositor_observer.h"
+#include "ui/compositor/compositor_vsync_manager.h"
#include "ui/gfx/display_observer.h"
#include "ui/gfx/rect.h"
#include "webkit/common/cursors/webcursor.h"
class Display;
}
+namespace gpu {
+struct Mailbox;
+}
+
namespace ui {
class CompositorLock;
+class CompositorVSyncManager;
class InputMethod;
+class LocatedEvent;
class Texture;
}
namespace content {
+#if defined(OS_WIN)
+class LegacyRenderWidgetHostHWND;
+#endif
+
class RenderWidgetHostImpl;
class RenderWidgetHostView;
class ResizeLock;
class CONTENT_EXPORT RenderWidgetHostViewAura
: public RenderWidgetHostViewBase,
public ui::CompositorObserver,
+ public ui::CompositorVSyncManager::Observer,
public ui::TextInputClient,
public gfx::DisplayObserver,
public aura::RootWindowObserver,
public base::SupportsWeakPtr<RenderWidgetHostViewAura>,
public cc::DelegatedFrameResourceCollectionClient {
public:
- // Used to notify whenever the paint-content of the view changes.
- class PaintObserver {
- public:
- PaintObserver() {}
- virtual ~PaintObserver() {}
-
- // This is called when painting of the page is completed.
- virtual void OnPaintComplete() = 0;
-
- // This is called when compositor painting of the page is completed.
- virtual void OnCompositingComplete() = 0;
-
- // This is called when the contents for compositor painting changes.
- virtual void OnUpdateCompositorContent() = 0;
-
- // This is called loading the page has completed.
- virtual void OnPageLoadComplete() = 0;
-
- // This is called when the view is destroyed, so that the observer can
- // perform any necessary clean-up.
- virtual void OnViewDestroyed() = 0;
- };
-
// Displays and controls touch editing elements such as selection handles.
class TouchEditingClient {
public:
virtual ~TouchEditingClient() {}
};
- void set_paint_observer(PaintObserver* observer) {
- paint_observer_ = observer;
- }
-
void set_touch_editing_client(TouchEditingClient* client) {
touch_editing_client_ = client;
}
virtual bool HasAcceleratedSurface(const gfx::Size& desired_size) OVERRIDE;
virtual void GetScreenInfo(blink::WebScreenInfo* results) OVERRIDE;
virtual gfx::Rect GetBoundsInRootWindow() OVERRIDE;
- virtual void GestureEventAck(int gesture_event_type,
+ virtual void GestureEventAck(const blink::WebGestureEvent& event,
InputEventAckState ack_result) OVERRIDE;
virtual void ProcessAckedTouchEvent(
const TouchEventWithLatencyInfo& touch,
// Method to indicate if this instance is shutting down or closing.
// TODO(shrikant): Discuss around to see if it makes sense to add this method
// as part of RenderWidgetHostView.
- bool IsClosing() const { return in_shutdown_; };
+ bool IsClosing() const { return in_shutdown_; }
protected:
friend class RenderWidgetHostView;
virtual void OnCompositingAborted(ui::Compositor* compositor) OVERRIDE;
virtual void OnCompositingLockStateChanged(
ui::Compositor* compositor) OVERRIDE;
- virtual void OnUpdateVSyncParameters(ui::Compositor* compositor,
- base::TimeTicks timebase,
+
+ // Overridden from ui::CompositorVSyncManager::Observer
+ virtual void OnUpdateVSyncParameters(base::TimeTicks timebase,
base::TimeDelta interval) OVERRIDE;
private:
scoped_ptr<cc::CopyOutputResult> result);
static void PrepareBitmapCopyOutputResult(
const gfx::Size& dst_size_in_pixel,
+ const SkBitmap::Config config,
const base::Callback<void(bool, const SkBitmap&)>& callback,
scoped_ptr<cc::CopyOutputResult> result);
static void CopyFromCompositingSurfaceHasResultForVideo(
// Detaches |this| from the input method object.
void DetachFromInputMethod();
- // Dismisses a Web Popup on mouse press outside the popup and its parent.
- void ApplyEventFilterForPopupExit(ui::MouseEvent* event);
+ // Dismisses a Web Popup on a mouse or touch press outside the popup and its
+ // parent.
+ void ApplyEventFilterForPopupExit(ui::LocatedEvent* event);
// Converts |rect| from window coordinate to screen coordinate.
gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const;
void BuffersSwapped(const gfx::Size& surface_size,
const gfx::Rect& damage_rect,
float surface_scale_factor,
- const std::string& mailbox_name,
+ const gpu::Mailbox& mailbox,
const std::vector<ui::LatencyInfo>& latency_info,
const BufferPresentedCallback& ack_callback);
bool SwapBuffersPrepare(const gfx::Rect& surface_rect,
float surface_scale_factor,
const gfx::Rect& damage_rect,
- const std::string& mailbox_name,
+ const gpu::Mailbox& mailbox,
const BufferPresentedCallback& ack_callback);
void SwapBuffersCompleted(
// Helper function to set keyboard focus to the main window.
void SetKeyboardFocus();
-#if defined(OS_WIN)
- // Updates the total list of cutout rects, which is the union of transient
- // windows and constrained windows.
- void UpdateCutoutRects();
-#endif
-
// The model object.
RenderWidgetHostImpl* host_;
// This holds the current software framebuffer, if any.
scoped_ptr<SoftwareFrameManager> software_frame_manager_;
+ // The vsync manager we are observing for changes, if any.
+ scoped_refptr<ui::CompositorVSyncManager> vsync_manager_;
+
// With delegated renderer, this is the last output surface, used to
// disambiguate resources with the same id coming from different output
// surfaces.
};
CursorVisibilityState cursor_visibility_state_in_renderer_;
- // An observer to notify that the paint content of the view has changed. The
- // observer is not owned by the view, and must remove itself as an oberver
- // when it is being destroyed.
- PaintObserver* paint_observer_;
-
#if defined(OS_WIN)
// The list of rectangles from constrained windows over this view. Windowed
// NPAPI plugins shouldn't draw over them.
base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_;
#if defined(OS_WIN)
- // The dummy HWND which corresponds to the bounds of the web page. This is
- // passed to windowless plugins like Flash/Silverlight, etc as the
- // container window.
- HWND plugin_parent_window_;
+ // The LegacyRenderWidgetHostHWND class provides a dummy HWND which is used
+ // for accessibility, as the container for windowless plugins like
+ // Flash/Silverlight, etc and for legacy drivers for trackpoints/trackpads,
+ // etc.
+ scoped_ptr<content::LegacyRenderWidgetHostHWND>
+ legacy_render_widget_host_HWND_;
#endif
DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAura);
};