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

Unified Diff: ui/views/selection_controller.cc

Issue 2379993005: Label selection experiment (Closed)
Patch Set: -- Created 4 years, 2 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
« no previous file with comments | « ui/views/selection_controller.h ('k') | ui/views/style/platform_style.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/selection_controller.cc
diff --git a/ui/views/selection_controller.cc b/ui/views/selection_controller.cc
index 704cffecc514783079099dc6378daebe67b46ce7..143a37345efe273cda02d8c84a7ca8b9b7296483 100644
--- a/ui/views/selection_controller.cc
+++ b/ui/views/selection_controller.cc
@@ -34,7 +34,8 @@ bool SelectionController::OnMousePressed(const ui::MouseEvent& event,
case 0:
// If the click location is within existing selection, it may be a
// potential drag and drop.
- if (GetRenderText()->IsPointInSelection(event.location())) {
+ if (delegate_->SupportsDrag() &&
+ GetRenderText()->IsPointInSelection(event.location())) {
delegate_->SetTextBeingDragged(true);
} else {
MoveCursorTo(event.location(), event.IsShiftDown());
@@ -204,7 +205,7 @@ void SelectionController::SelectThroughLastDragLocation() {
delegate_->OnBeforeMouseAction();
// Todo(karandeepb): See if this can be handled at the RenderText level.
- const bool drags_to_end = PlatformStyle::kTextfieldDragVerticallyDragsToEnd;
+ const bool drags_to_end = PlatformStyle::kTextDragVerticallyDragsToEnd;
if (drags_to_end && last_drag_location_.y() < 0)
SelectTillEdge(gfx::CURSOR_LEFT);
else if (drags_to_end && last_drag_location_.y() > delegate_->GetViewHeight())
« no previous file with comments | « ui/views/selection_controller.h ('k') | ui/views/style/platform_style.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698