Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include "ui/views/touchui/touch_selection_controller_impl.h" | 5 #include "ui/views/touchui/touch_selection_controller_impl.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "ui/aura/client/cursor_client.h" | 10 #include "ui/aura/client/cursor_client.h" |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 636 client_view_->ExecuteCommand(command_id, event_flags); | 636 client_view_->ExecuteCommand(command_id, event_flags); |
| 637 } | 637 } |
| 638 | 638 |
| 639 void TouchSelectionControllerImpl::RunContextMenu() { | 639 void TouchSelectionControllerImpl::RunContextMenu() { |
| 640 // Context menu should appear centered on top of the selected region. | 640 // Context menu should appear centered on top of the selected region. |
| 641 const gfx::Rect rect = GetQuickMenuAnchorRect(); | 641 const gfx::Rect rect = GetQuickMenuAnchorRect(); |
| 642 const gfx::Point anchor(rect.CenterPoint().x(), rect.y()); | 642 const gfx::Point anchor(rect.CenterPoint().x(), rect.y()); |
| 643 client_view_->OpenContextMenu(anchor); | 643 client_view_->OpenContextMenu(anchor); |
| 644 } | 644 } |
| 645 | 645 |
| 646 void TouchSelectionControllerImpl::OnAncestorWindowTransformed( | |
| 647 aura::Window* window, | |
| 648 aura::Window* ancestor) { | |
| 649 client_view_->DestroyTouchSelection(); | |
| 650 } | |
| 651 | |
|
sammiequon
2017/06/06 19:01:27
Would removing this have other undesired effects?
mohsen
2017/06/07 18:20:38
This was added for Project Athena where we had tex
sammiequon
2017/06/07 18:53:49
Acknowledged. Do you think we should revert https:
| |
| 652 void TouchSelectionControllerImpl::OnWidgetClosing(Widget* widget) { | 646 void TouchSelectionControllerImpl::OnWidgetClosing(Widget* widget) { |
| 653 DCHECK_EQ(client_widget_, widget); | 647 DCHECK_EQ(client_widget_, widget); |
| 654 client_widget_->RemoveObserver(this); | 648 client_widget_->RemoveObserver(this); |
| 655 client_widget_ = nullptr; | 649 client_widget_ = nullptr; |
| 656 } | 650 } |
| 657 | 651 |
| 658 void TouchSelectionControllerImpl::OnWidgetBoundsChanged( | 652 void TouchSelectionControllerImpl::OnWidgetBoundsChanged( |
| 659 Widget* widget, | 653 Widget* widget, |
| 660 const gfx::Rect& new_bounds) { | 654 const gfx::Rect& new_bounds) { |
| 661 DCHECK_EQ(client_widget_, widget); | 655 DCHECK_EQ(client_widget_, widget); |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 788 | 782 |
| 789 views::WidgetDelegateView* TouchSelectionControllerImpl::GetHandle1View() { | 783 views::WidgetDelegateView* TouchSelectionControllerImpl::GetHandle1View() { |
| 790 return selection_handle_1_.get(); | 784 return selection_handle_1_.get(); |
| 791 } | 785 } |
| 792 | 786 |
| 793 views::WidgetDelegateView* TouchSelectionControllerImpl::GetHandle2View() { | 787 views::WidgetDelegateView* TouchSelectionControllerImpl::GetHandle2View() { |
| 794 return selection_handle_2_.get(); | 788 return selection_handle_2_.get(); |
| 795 } | 789 } |
| 796 | 790 |
| 797 } // namespace views | 791 } // namespace views |
| OLD | NEW |