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

Unified Diff: ui/views/touchui/touch_selection_controller_impl.cc

Issue 551883002: Deactivate touch selection on transform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Used the new propagated transformed event Created 6 years, 3 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/touchui/touch_selection_controller_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/touchui/touch_selection_controller_impl.cc
diff --git a/ui/views/touchui/touch_selection_controller_impl.cc b/ui/views/touchui/touch_selection_controller_impl.cc
index f77df761fb52d8ba8f5cbd54530c070728bfc1ee..4b097624988f5216d4477fff054a8ec97aade615 100644
--- a/ui/views/touchui/touch_selection_controller_impl.cc
+++ b/ui/views/touchui/touch_selection_controller_impl.cc
@@ -327,8 +327,9 @@ TouchSelectionControllerImpl::TouchSelectionControllerImpl(
client_view->GetNativeView())),
context_menu_(NULL),
dragging_handle_(NULL) {
- client_widget_ = Widget::GetTopLevelWidgetForNativeView(
- client_view_->GetNativeView());
+ aura::Window* client_window = client_view_->GetNativeView();
+ client_window->AddObserver(this);
+ client_widget_ = Widget::GetTopLevelWidgetForNativeView(client_window);
if (client_widget_)
client_widget_->AddObserver(this);
aura::Env::GetInstance()->AddPreTargetHandler(this);
@@ -339,6 +340,7 @@ TouchSelectionControllerImpl::~TouchSelectionControllerImpl() {
aura::Env::GetInstance()->RemovePreTargetHandler(this);
if (client_widget_)
client_widget_->RemoveObserver(this);
+ client_view_->GetNativeView()->RemoveObserver(this);
}
void TouchSelectionControllerImpl::SelectionChanged() {
@@ -509,6 +511,12 @@ void TouchSelectionControllerImpl::OnMenuClosed(TouchEditingMenuView* menu) {
context_menu_ = NULL;
}
+void TouchSelectionControllerImpl::OnAncestorWindowTransformed(
+ aura::Window* window,
+ aura::Window* ancestor) {
+ client_view_->DestroyTouchSelection();
+}
+
void TouchSelectionControllerImpl::OnWidgetClosing(Widget* widget) {
DCHECK_EQ(client_widget_, widget);
client_widget_ = NULL;
« no previous file with comments | « ui/views/touchui/touch_selection_controller_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698