Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: ui/gfx/selection_bound.h

Issue 2034863002: Move SelectionBound from ui/base/touch to ui/gfx to be used by cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated views_unittests Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/gfx_tests.gyp ('k') | ui/gfx/selection_bound.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_BASE_TOUCH_SELECTION_BOUND_H_ 5 #ifndef UI_GFX_SELECTION_BOUND_H_
6 #define UI_BASE_TOUCH_SELECTION_BOUND_H_ 6 #define UI_GFX_SELECTION_BOUND_H_
7 7
8 #include "ui/base/ui_base_export.h"
9 #include "ui/gfx/geometry/point.h" 8 #include "ui/gfx/geometry/point.h"
10 #include "ui/gfx/geometry/point_f.h" 9 #include "ui/gfx/geometry/point_f.h"
10 #include "ui/gfx/gfx_export.h"
11 11
12 namespace gfx { 12 namespace gfx {
13
13 class Rect; 14 class Rect;
14 class RectF; 15 class RectF;
15 }
16
17 namespace ui {
18 16
19 // Bound of a selection end-point. 17 // Bound of a selection end-point.
20 class UI_BASE_EXPORT SelectionBound { 18 class GFX_EXPORT SelectionBound {
21 public: 19 public:
22 enum Type { 20 enum Type { LEFT, RIGHT, CENTER, EMPTY, LAST = EMPTY };
23 LEFT,
24 RIGHT,
25 CENTER,
26 EMPTY,
27 LAST = EMPTY
28 };
29 21
30 SelectionBound(); 22 SelectionBound();
31 SelectionBound(const SelectionBound& other); 23 SelectionBound(const SelectionBound& other);
32 ~SelectionBound(); 24 ~SelectionBound();
33 25
34 Type type() const { return type_; } 26 Type type() const { return type_; }
35 void set_type(Type value) { type_ = value; } 27 void set_type(Type value) { type_ = value; }
36 28
37 const gfx::PointF& edge_top() const { return edge_top_; } 29 const gfx::PointF& edge_top() const { return edge_top_; }
38 const gfx::Point& edge_top_rounded() const { return edge_top_rounded_; } 30 const gfx::Point& edge_top_rounded() const { return edge_top_rounded_; }
(...skipping 13 matching lines...) Expand all
52 44
53 private: 45 private:
54 Type type_; 46 Type type_;
55 gfx::PointF edge_top_; 47 gfx::PointF edge_top_;
56 gfx::PointF edge_bottom_; 48 gfx::PointF edge_bottom_;
57 gfx::Point edge_top_rounded_; 49 gfx::Point edge_top_rounded_;
58 gfx::Point edge_bottom_rounded_; 50 gfx::Point edge_bottom_rounded_;
59 bool visible_; 51 bool visible_;
60 }; 52 };
61 53
62 UI_BASE_EXPORT bool operator==(const SelectionBound& lhs, 54 GFX_EXPORT bool operator==(const SelectionBound& lhs,
63 const SelectionBound& rhs); 55 const SelectionBound& rhs);
64 UI_BASE_EXPORT bool operator!=(const SelectionBound& lhs, 56 GFX_EXPORT bool operator!=(const SelectionBound& lhs,
65 const SelectionBound& rhs); 57 const SelectionBound& rhs);
66 58
67 UI_BASE_EXPORT gfx::Rect RectBetweenSelectionBounds(const SelectionBound& b1, 59 GFX_EXPORT gfx::Rect RectBetweenSelectionBounds(const SelectionBound& b1,
68 const SelectionBound& b2); 60 const SelectionBound& b2);
69 61
70 UI_BASE_EXPORT gfx::RectF RectFBetweenSelectionBounds(const SelectionBound& b1, 62 GFX_EXPORT gfx::RectF RectFBetweenSelectionBounds(const SelectionBound& b1,
71 const SelectionBound& b2); 63 const SelectionBound& b2);
72 64
73 } // namespace ui 65 } // namespace ui
74 66
75 #endif // UI_BASE_TOUCH_SELECTION_BOUND_H_ 67 #endif // UI_GFX_SELECTION_BOUND_H_
OLDNEW
« no previous file with comments | « ui/gfx/gfx_tests.gyp ('k') | ui/gfx/selection_bound.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698