Chromium Code Reviews| Index: content/browser/web_contents/aura/touch_selection_controller_client_aura.h |
| diff --git a/content/browser/web_contents/aura/touch_selection_controller_client_aura.h b/content/browser/web_contents/aura/touch_selection_controller_client_aura.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cb30cee83a5cd43102f3bd4165ad34a8aed8649d |
| --- /dev/null |
| +++ b/content/browser/web_contents/aura/touch_selection_controller_client_aura.h |
| @@ -0,0 +1,62 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_WEB_CONTENTS_AURA_TOUCH_SELECTION_CONTROLLER_CLIENT_AURA_H_ |
| +#define CONTENT_BROWSER_WEB_CONTENTS_AURA_TOUCH_SELECTION_CONTROLLER_CLIENT_AURA_H_ |
| + |
| +#include "base/timer/timer.h" |
| +#include "content/common/content_export.h" |
| +#include "ui/touch_selection/touch_selection_controller.h" |
| +#include "ui/touch_selection/touch_selection_menu_runner.h" |
| + |
| +namespace content { |
| +class RenderWidgetHostViewAura; |
| + |
| +// An implementation of |TouchSelectionControllerClient| to be used in Aura's |
| +// implementation of touch selection for contents. |
| +class CONTENT_EXPORT TouchSelectionControllerClientAura |
| + : public ui::TouchSelectionControllerClient, |
| + public ui::TouchSelectionMenuClient { |
| + public: |
| + explicit TouchSelectionControllerClientAura(RenderWidgetHostViewAura* rwhva); |
| + ~TouchSelectionControllerClientAura() override; |
| + |
| + private: |
| + class EnvPreTargetHandler; |
| + |
| + // ui::TouchSelectionControllerClient: |
| + bool SupportsAnimation() const override; |
| + void SetNeedsAnimate() override; |
| + void MoveCaret(const gfx::PointF& position) override; |
| + void MoveRangeSelectionExtent(const gfx::PointF& extent) override; |
| + void SelectBetweenCoordinates(const gfx::PointF& base, |
| + const gfx::PointF& extent) override; |
| + void OnSelectionEvent(ui::SelectionEventType event) override; |
| + scoped_ptr<ui::TouchHandleDrawable> CreateDrawable() override; |
| + void OnScrollStarted() override; |
| + void OnScrollCompleted() override; |
| + |
| + // ui::TouchSelectionMenuClient: |
| + bool IsCommandIdEnabled(int command_id) const override; |
| + void ExecuteCommand(int command_id, int event_flags) override; |
| + void OpenContextMenu() override; |
| + |
| + bool IsQuickMenuAllowed() const; |
| + void ShowQuickMenu(); |
| + void UpdateQuickMenu(); |
|
sadrul
2015/04/29 19:55:03
non-overrides before overrides
mohsen
2015/04/30 18:29:34
Done.
|
| + |
| + // Not owned, non-null for the lifetime of this object. |
| + RenderWidgetHostViewAura* rwhva_; |
| + |
| + base::Timer quick_menu_timer_; |
| + bool scroll_in_progress_; |
| + bool handle_drag_in_progress_; |
| + scoped_ptr<EnvPreTargetHandler> env_pre_target_handler_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(TouchSelectionControllerClientAura); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_WEB_CONTENTS_AURA_TOUCH_SELECTION_CONTROLLER_CLIENT_AURA_H_ |