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

Side by Side Diff: ui/base/touch/touch_editing_controller.h

Issue 759433002: Reland: Move TouchSelectionController from content to ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Excluded ui/touch_selection from Windows GN build Created 6 years 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/base/touch/selection_bound_unittest.cc ('k') | ui/base/touch/touch_editing_controller.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_TOUCH_EDITING_CONTROLLER_H_ 5 #ifndef UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_
6 #define UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_ 6 #define UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_
7 7
8 #include "ui/base/models/simple_menu_model.h" 8 #include "ui/base/models/simple_menu_model.h"
9 #include "ui/gfx/point.h" 9
10 #include "ui/gfx/rect.h" 10 namespace gfx {
11 class Point;
12 class Rect;
13 }
11 14
12 namespace ui { 15 namespace ui {
13 16 class SelectionBound;
14 // Bound of a selected region.
15 struct UI_BASE_EXPORT SelectionBound {
16 public:
17 enum Type {
18 LEFT,
19 RIGHT,
20 CENTER,
21 EMPTY,
22 LAST = EMPTY
23 };
24
25 SelectionBound();
26 ~SelectionBound();
27
28 int GetHeight() const;
29
30 Type type;
31
32 gfx::Point edge_top;
33 gfx::Point edge_bottom;
34 };
35
36 UI_BASE_EXPORT bool operator==(const SelectionBound& lhs,
37 const SelectionBound& rhs);
38 UI_BASE_EXPORT bool operator!=(const SelectionBound& lhs,
39 const SelectionBound& rhs);
40
41 UI_BASE_EXPORT gfx::Rect RectBetweenSelectionBounds(const SelectionBound& b1,
42 const SelectionBound& b2);
43 17
44 // An interface implemented by widget that has text that can be selected/edited 18 // An interface implemented by widget that has text that can be selected/edited
45 // using touch. 19 // using touch.
46 class UI_BASE_EXPORT TouchEditable : public ui::SimpleMenuModel::Delegate { 20 class UI_BASE_EXPORT TouchEditable : public ui::SimpleMenuModel::Delegate {
47 public: 21 public:
48 // TODO(mohsen): Consider switching from local coordinates to screen 22 // TODO(mohsen): Consider switching from local coordinates to screen
49 // coordinates in this interface and see if it will simplify things. 23 // coordinates in this interface and see if it will simplify things.
50 24
51 // Select everything between start and end (points are in view's local 25 // Select everything between start and end (points are in view's local
52 // coordinate system). |start| is the logical start and |end| is the logical 26 // coordinate system). |start| is the logical start and |end| is the logical
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 95
122 virtual TouchSelectionController* create(TouchEditable* client_view) = 0; 96 virtual TouchSelectionController* create(TouchEditable* client_view) = 0;
123 97
124 protected: 98 protected:
125 virtual ~TouchSelectionControllerFactory() {} 99 virtual ~TouchSelectionControllerFactory() {}
126 }; 100 };
127 101
128 } // namespace ui 102 } // namespace ui
129 103
130 #endif // UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_ 104 #endif // UI_BASE_TOUCH_TOUCH_EDITING_CONTROLLER_H_
OLDNEW
« no previous file with comments | « ui/base/touch/selection_bound_unittest.cc ('k') | ui/base/touch/touch_editing_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698