| Index: content/browser/renderer_host/render_widget_host_view_aura.h
|
| diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
|
| index 3fd721091fd229a4d996108d98c706f0846c1dd6..7905b8ad2e59884d3e68337487bd69efcc4683a8 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_aura.h
|
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.h
|
| @@ -65,6 +65,8 @@ class CompositorLock;
|
| class InputMethod;
|
| class LocatedEvent;
|
| class Texture;
|
| +class TouchSelectionControllerAura;
|
| +class TouchSelectionControllerAuraClient;
|
| }
|
|
|
| namespace content {
|
| @@ -90,49 +92,6 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
|
| public aura::client::FocusChangeObserver,
|
| public aura::client::CursorClientObserver {
|
| public:
|
| - // Displays and controls touch editing elements such as selection handles.
|
| - class TouchEditingClient {
|
| - public:
|
| - TouchEditingClient() {}
|
| -
|
| - // Tells the client to start showing touch editing handles.
|
| - virtual void StartTouchEditing() = 0;
|
| -
|
| - // Notifies the client that touch editing is no longer needed. |quick|
|
| - // determines whether the handles should fade out quickly or slowly.
|
| - virtual void EndTouchEditing(bool quick) = 0;
|
| -
|
| - // Notifies the client that the selection bounds need to be updated.
|
| - virtual void OnSelectionOrCursorChanged(
|
| - const ui::SelectionBound& anchor,
|
| - const ui::SelectionBound& focus) = 0;
|
| -
|
| - // Notifies the client that the current text input type as changed.
|
| - virtual void OnTextInputTypeChanged(ui::TextInputType type) = 0;
|
| -
|
| - // Notifies the client that an input event is about to be sent to the
|
| - // renderer. Returns true if the client wants to stop event propagation.
|
| - virtual bool HandleInputEvent(const ui::Event* event) = 0;
|
| -
|
| - // Notifies the client that a gesture event ack was received.
|
| - virtual void GestureEventAck(int gesture_event_type) = 0;
|
| -
|
| - // Notifies the client that the fling has ended, so it can activate touch
|
| - // editing if needed.
|
| - virtual void DidStopFlinging() = 0;
|
| -
|
| - // This is called when the view is destroyed, so that the client can
|
| - // perform any necessary clean-up.
|
| - virtual void OnViewDestroyed() = 0;
|
| -
|
| - protected:
|
| - virtual ~TouchEditingClient() {}
|
| - };
|
| -
|
| - void set_touch_editing_client(TouchEditingClient* client) {
|
| - touch_editing_client_ = client;
|
| - }
|
| -
|
| // When |is_guest_view_hack| is true, this view isn't really the view for
|
| // the |widget|, a RenderWidgetHostViewGuest is.
|
| //
|
| @@ -140,6 +99,10 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
|
| // to use RWHVChildFrame (http://crbug.com/330264).
|
| RenderWidgetHostViewAura(RenderWidgetHost* host, bool is_guest_view_hack);
|
|
|
| + // TODO(mfomitchev): create to wm::ConvertRectToScreen and use that instead.
|
| + // Converts |rect| from window coordinate to screen coordinate.
|
| + gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const;
|
| +
|
| // RenderWidgetHostView implementation.
|
| bool OnMessageReceived(const IPC::Message& msg) override;
|
| void InitAsChild(gfx::NativeView parent_view) override;
|
| @@ -350,6 +313,13 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
|
|
|
| void SnapToPhysicalPixelBoundary();
|
|
|
| + void InitSelectionController(
|
| + ui::TouchSelectionControllerAuraClient* selection_controller_client);
|
| +
|
| + ui::TouchSelectionControllerAura* selection_controller() {
|
| + return selection_controller_.get();
|
| + }
|
| +
|
| OverscrollController* overscroll_controller() const {
|
| return overscroll_controller_.get();
|
| }
|
| @@ -471,9 +441,6 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
|
| // parent.
|
| void ApplyEventFilterForPopupExit(ui::LocatedEvent* event);
|
|
|
| - // Converts |rect| from window coordinate to screen coordinate.
|
| - gfx::Rect ConvertRectToScreen(const gfx::Rect& rect) const;
|
| -
|
| // Converts |rect| from screen coordinate to window coordinate.
|
| gfx::Rect ConvertRectFromScreen(const gfx::Rect& rect) const;
|
|
|
| @@ -482,6 +449,10 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
|
|
|
| RenderFrameHostImpl* GetFocusedFrame();
|
|
|
| + // ...
|
| + void SelectionBoundsUpdated(const ui::SelectionBound& start,
|
| + const ui::SelectionBound& end);
|
| +
|
| // The model object.
|
| RenderWidgetHostImpl* host_;
|
|
|
| @@ -530,10 +501,6 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
|
| int text_input_flags_;
|
| bool can_compose_inline_;
|
|
|
| - // Bounds for the selection.
|
| - ui::SelectionBound selection_anchor_;
|
| - ui::SelectionBound selection_focus_;
|
| -
|
| // The current composition character bounds.
|
| std::vector<gfx::Rect> composition_character_bounds_;
|
|
|
| @@ -612,7 +579,9 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
|
|
|
| bool has_snapped_to_boundary_;
|
|
|
| - TouchEditingClient* touch_editing_client_;
|
| + scoped_ptr<ui::TouchSelectionControllerAuraClient>
|
| + selection_controller_client_;
|
| + scoped_ptr<ui::TouchSelectionControllerAura> selection_controller_;
|
|
|
| scoped_ptr<OverscrollController> overscroll_controller_;
|
|
|
|
|