summaryrefslogtreecommitdiff
path: root/chromium/content/browser/renderer_host/input/touch_selection_controller_client_aura.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-17 13:57:45 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-19 13:44:40 +0000
commit6ec7b8da05d21a3878bd21c691b41e675d74bb1c (patch)
treeb87f250bc19413750b9bb9cdbf2da20ef5014820 /chromium/content/browser/renderer_host/input/touch_selection_controller_client_aura.h
parentec02ee4181c49b61fce1c8fb99292dbb8139cc90 (diff)
downloadqtwebengine-chromium-6ec7b8da05d21a3878bd21c691b41e675d74bb1c.tar.gz
BASELINE: Update Chromium to 60.0.3112.70
Change-Id: I9911c2280a014d4632f254857876a395d4baed2d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/content/browser/renderer_host/input/touch_selection_controller_client_aura.h')
-rw-r--r--chromium/content/browser/renderer_host/input/touch_selection_controller_client_aura.h48
1 files changed, 47 insertions, 1 deletions
diff --git a/chromium/content/browser/renderer_host/input/touch_selection_controller_client_aura.h b/chromium/content/browser/renderer_host/input/touch_selection_controller_client_aura.h
index 0d6dba6a4d8..1aecd588d00 100644
--- a/chromium/content/browser/renderer_host/input/touch_selection_controller_client_aura.h
+++ b/chromium/content/browser/renderer_host/input/touch_selection_controller_client_aura.h
@@ -8,7 +8,9 @@
#include <memory>
#include "base/macros.h"
+#include "base/observer_list.h"
#include "base/timer/timer.h"
+#include "content/browser/renderer_host/input/touch_selection_controller_client_manager.h"
#include "content/common/content_export.h"
#include "ui/touch_selection/touch_selection_controller.h"
#include "ui/touch_selection/touch_selection_menu_runner.h"
@@ -21,7 +23,8 @@ class RenderWidgetHostViewAura;
// implementation of touch selection for contents.
class CONTENT_EXPORT TouchSelectionControllerClientAura
: public ui::TouchSelectionControllerClient,
- public ui::TouchSelectionMenuClient {
+ public ui::TouchSelectionMenuClient,
+ public TouchSelectionControllerClientManager {
public:
explicit TouchSelectionControllerClientAura(RenderWidgetHostViewAura* rwhva);
~TouchSelectionControllerClientAura() override;
@@ -48,6 +51,22 @@ class CONTENT_EXPORT TouchSelectionControllerClientAura
// selection events. (http://crbug.com/548245)
bool HandleContextMenu(const ContextMenuParams& params);
+ void UpdateClientSelectionBounds(const gfx::SelectionBound& start,
+ const gfx::SelectionBound& end);
+
+ // TouchSelectionControllerClientManager.
+ void UpdateClientSelectionBounds(
+ const gfx::SelectionBound& start,
+ const gfx::SelectionBound& end,
+ ui::TouchSelectionControllerClient* client,
+ ui::TouchSelectionMenuClient* menu_client) override;
+ void InvalidateClient(ui::TouchSelectionControllerClient* client) override;
+ ui::TouchSelectionController* GetTouchSelectionController() override;
+ void AddObserver(
+ TouchSelectionControllerClientManager::Observer* observer) override;
+ void RemoveObserver(
+ TouchSelectionControllerClientManager::Observer* observer) override;
+
private:
friend class TestTouchSelectionControllerClientAura;
class EnvPreTargetHandler;
@@ -74,6 +93,33 @@ class CONTENT_EXPORT TouchSelectionControllerClientAura
// Not owned, non-null for the lifetime of this object.
RenderWidgetHostViewAura* rwhva_;
+ class InternalClient : public TouchSelectionControllerClient {
+ public:
+ InternalClient(RenderWidgetHostViewAura* rwhva) : rwhva_(rwhva) {}
+ ~InternalClient() final {}
+
+ bool SupportsAnimation() const final;
+ void SetNeedsAnimate() final;
+ void MoveCaret(const gfx::PointF& position) final;
+ void MoveRangeSelectionExtent(const gfx::PointF& extent) final;
+ void SelectBetweenCoordinates(const gfx::PointF& base,
+ const gfx::PointF& extent) final;
+ void OnSelectionEvent(ui::SelectionEventType event) final;
+ std::unique_ptr<ui::TouchHandleDrawable> CreateDrawable() final;
+
+ private:
+ RenderWidgetHostViewAura* rwhva_;
+ } internal_client_;
+
+ // Keep track of which client interface to use.
+ TouchSelectionControllerClient* active_client_;
+ TouchSelectionMenuClient* active_menu_client_;
+ gfx::SelectionBound manager_selection_start_;
+ gfx::SelectionBound manager_selection_end_;
+
+ base::ObserverList<TouchSelectionControllerClientManager::Observer>
+ observers_;
+
base::Timer quick_menu_timer_;
bool quick_menu_requested_;
bool touch_down_;