| Index: ui/touch_selection/touch_handle_drawable_aura.h
|
| diff --git a/ui/touch_selection/touch_handle_drawable_aura.h b/ui/touch_selection/touch_handle_drawable_aura.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f25a7a3890b6071af91cdcdf4f1e4d90db15044c
|
| --- /dev/null
|
| +++ b/ui/touch_selection/touch_handle_drawable_aura.h
|
| @@ -0,0 +1,53 @@
|
| +// Copyright 2014 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 UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_
|
| +#define UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_
|
| +
|
| +#include "ui/aura/image_window_delegate.h"
|
| +#include "ui/touch_selection/touch_handle.h"
|
| +
|
| +namespace ui {
|
| +
|
| +class TouchHandleDrawableAura : public TouchHandleDrawable,
|
| + public aura::ImageWindowDelegate {
|
| + public:
|
| + // Returns the maximum width/height that can be occupied by a handle image.
|
| + static gfx::Size GetMaxHandleImageSize();
|
| +
|
| + explicit TouchHandleDrawableAura(aura::Window* parent);
|
| + ~TouchHandleDrawableAura() override;
|
| +
|
| + private:
|
| + friend class TouchSelectionControllerAuraTest;
|
| +
|
| + void UpdateBounds();
|
| +
|
| + // TouchHandleDrawable:
|
| + void SetEnabled(bool enabled) override;
|
| + void SetOrientation(TouchHandleOrientation orientation) override;
|
| + void SetAlpha(float alpha) override;
|
| + void SetFocus(const gfx::PointF& position) override;
|
| + gfx::RectF GetVisibleBounds() const override;
|
| +
|
| + aura::Window* window_for_testing() const { return window_.get(); }
|
| +
|
| + scoped_ptr<aura::Window> window_;
|
| + bool enabled_;
|
| + float alpha_;
|
| + TouchHandleOrientation orientation_;
|
| +
|
| + // Focal position of the handle set via SetFocus (normally located on the
|
| + // intersection of the cursor line and the text base line).
|
| + gfx::PointF focal_position_;
|
| +
|
| + // Window bounds relative to the focal position.
|
| + gfx::RectF relative_bounds_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TouchHandleDrawableAura);
|
| +};
|
| +
|
| +} // namespace ui
|
| +
|
| +#endif // UI_TOUCH_SELECTION_TOUCH_HANDLE_DRAWABLE_AURA_H_
|
|
|