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

Unified Diff: ui/touch_selection/touch_selection_controller.cc

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, 7 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 side-by-side diff with in-line comments
Download patch
Index: ui/touch_selection/touch_selection_controller.cc
diff --git a/ui/touch_selection/touch_selection_controller.cc b/ui/touch_selection/touch_selection_controller.cc
index d75a73d16ced6e3609a0cdca93808a3a81cb54be..ed8c1cca6ff6adb5be2608c9154c65fce5de3752 100644
--- a/ui/touch_selection/touch_selection_controller.cc
+++ b/ui/touch_selection/touch_selection_controller.cc
@@ -12,7 +12,7 @@
namespace ui {
namespace {
-gfx::Vector2dF ComputeLineOffsetFromBottom(const SelectionBound& bound) {
+gfx::Vector2dF ComputeLineOffsetFromBottom(const gfx::SelectionBound& bound) {
gfx::Vector2dF line_offset =
gfx::ScaleVector2d(bound.edge_top() - bound.edge_bottom(), 0.5f);
// An offset of 8 DIPs is sufficient for most line sizes. For small lines,
@@ -24,15 +24,16 @@ gfx::Vector2dF ComputeLineOffsetFromBottom(const SelectionBound& bound) {
return line_offset;
}
-TouchHandleOrientation ToTouchHandleOrientation(SelectionBound::Type type) {
+TouchHandleOrientation ToTouchHandleOrientation(
+ gfx::SelectionBound::Type type) {
switch (type) {
- case SelectionBound::LEFT:
+ case gfx::SelectionBound::LEFT:
return TouchHandleOrientation::LEFT;
- case SelectionBound::RIGHT:
+ case gfx::SelectionBound::RIGHT:
return TouchHandleOrientation::RIGHT;
- case SelectionBound::CENTER:
+ case gfx::SelectionBound::CENTER:
return TouchHandleOrientation::CENTER;
- case SelectionBound::EMPTY:
+ case gfx::SelectionBound::EMPTY:
return TouchHandleOrientation::UNDEFINED;
}
NOTREACHED() << "Invalid selection bound type: " << type;
@@ -76,17 +77,17 @@ TouchSelectionController::~TouchSelectionController() {
}
void TouchSelectionController::OnSelectionBoundsChanged(
- const SelectionBound& start,
- const SelectionBound& end) {
+ const gfx::SelectionBound& start,
+ const gfx::SelectionBound& end) {
if (!force_next_update_ && start == start_ && end_ == end)
return;
// Notify if selection bounds have just been established or dissolved.
- if (start.type() != SelectionBound::EMPTY &&
- start_.type() == SelectionBound::EMPTY) {
+ if (start.type() != gfx::SelectionBound::EMPTY &&
+ start_.type() == gfx::SelectionBound::EMPTY) {
client_->OnSelectionEvent(SELECTION_ESTABLISHED);
- } else if (start.type() == SelectionBound::EMPTY &&
- start_.type() != SelectionBound::EMPTY) {
+ } else if (start.type() == gfx::SelectionBound::EMPTY &&
+ start_.type() != gfx::SelectionBound::EMPTY) {
client_->OnSelectionEvent(SELECTION_DISSOLVED);
}
@@ -625,8 +626,8 @@ void TouchSelectionController::ForceNextUpdateIfInactive() {
// considered "inactive", i.e., it wasn't preceded by a user gesture or
// the handles have since been explicitly hidden.
if (active_status_ == INACTIVE &&
- start_.type() != SelectionBound::EMPTY &&
- end_.type() != SelectionBound::EMPTY) {
+ start_.type() != gfx::SelectionBound::EMPTY &&
+ end_.type() != gfx::SelectionBound::EMPTY) {
force_next_update_ = true;
}
}
« no previous file with comments | « ui/touch_selection/touch_selection_controller.h ('k') | ui/touch_selection/touch_selection_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698