Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / ash / wm / toplevel_window_event_handler.cc
index 872fd03..f20a13f 100644 (file)
@@ -232,14 +232,14 @@ void ToplevelWindowEventHandler::OnGestureEvent(ui::GestureEvent* event) {
       if (!(WindowResizer::GetBoundsChangeForWindowComponent(component) &
             WindowResizer::kBoundsChange_Resizes))
         return;
-      internal::ResizeShadowController* controller =
+      ResizeShadowController* controller =
           Shell::GetInstance()->resize_shadow_controller();
       if (controller)
         controller->ShowShadow(target, component);
       return;
     }
     case ui::ET_GESTURE_END: {
-      internal::ResizeShadowController* controller =
+      ResizeShadowController* controller =
           Shell::GetInstance()->resize_shadow_controller();
       if (controller)
         controller->HideShadow(target);
@@ -476,7 +476,10 @@ void ToplevelWindowEventHandler::HandleMousePressed(
         ConvertPointToParent(target, event->location()));
     AttemptToStartDrag(target, location_in_parent, component,
                        aura::client::WINDOW_MOVE_SOURCE_MOUSE);
-    event->StopPropagation();
+    // Set as handled so that other event handlers do no act upon the event
+    // but still receive it so that they receive both parts of each pressed/
+    // released pair.
+    event->SetHandled();
   } else {
     CompleteDrag(DRAG_COMPLETE);
   }
@@ -491,12 +494,13 @@ void ToplevelWindowEventHandler::HandleMouseReleased(
   CompleteDrag(event->type() == ui::ET_MOUSE_RELEASED ?
                    DRAG_COMPLETE : DRAG_REVERT);
   // Completing the drag may result in hiding the window. If this happens
-  // return true so no other handlers/observers see the event. Otherwise
-  // they see the event on a hidden window.
+  // mark the event as handled so no other handlers/observers act upon the
+  // event. They should see the event on a hidden window, to determine targets
+  // of destructive actions such as hiding. They should not act upon them.
   if (window_resizer_ &&
       event->type() == ui::ET_MOUSE_CAPTURE_CHANGED &&
       !target->IsVisible()) {
-    event->StopPropagation();
+    event->SetHandled();
   }
 }
 
@@ -532,7 +536,7 @@ void ToplevelWindowEventHandler::HandleMouseMoved(
 
   // TODO(jamescook): Move the resize cursor update code into here from
   // CompoundEventFilter?
-  internal::ResizeShadowController* controller =
+  ResizeShadowController* controller =
       Shell::GetInstance()->resize_shadow_controller();
   if (controller) {
     if (event->flags() & ui::EF_IS_NON_CLIENT) {
@@ -554,7 +558,7 @@ void ToplevelWindowEventHandler::HandleMouseExited(
   if (event->phase() != ui::EP_POSTTARGET)
     return;
 
-  internal::ResizeShadowController* controller =
+  ResizeShadowController* controller =
       Shell::GetInstance()->resize_shadow_controller();
   if (controller)
     controller->HideShadow(target);