| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/wm/workspace/workspace_event_handler.h" | 5 #include "ash/wm/workspace/workspace_event_handler.h" |
| 6 | 6 |
| 7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
| 8 #include "ui/aura/window_delegate.h" | 8 #include "ui/aura/window_delegate.h" |
| 9 | 9 |
| 10 namespace ash { | 10 namespace ash { |
| 11 | 11 |
| 12 WorkspaceEventHandler::WorkspaceEventHandler() { | 12 WorkspaceEventHandler::WorkspaceEventHandler() { |
| 13 } | 13 } |
| 14 | 14 |
| 15 WorkspaceEventHandler::~WorkspaceEventHandler() { | 15 WorkspaceEventHandler::~WorkspaceEventHandler() { |
| 16 } | 16 } |
| 17 | 17 |
| 18 void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) { | 18 void WorkspaceEventHandler::OnMouseEvent(ui::MouseEvent* event) { |
| 19 if (event->handled()) | 19 if (event->handled()) |
| 20 return; | 20 return; |
| 21 | 21 |
| 22 if (event->type() == ui::ET_MOUSE_MOVED) { | 22 if (event->type() == ui::ET_MOUSE_MOVED) { |
| 23 aura::Window* target = static_cast<aura::Window*>(event->target()); | 23 aura::Window* target = static_cast<aura::Window*>(event->target()); |
| 24 int component = | 24 int component = |
| 25 target->delegate()->GetNonClientComponent(event->location()); | 25 target->delegate()->GetNonClientComponent(event->location()); |
| 26 multi_window_resize_controller_.Show(target, component, event->location()); | 26 multi_window_resize_controller_.Show(target, component, event->location()); |
| 27 } else if (event->type() == ui::ET_MOUSE_PRESSED) { | |
| 28 // The multi window resizer does not hide as a result of a single click | |
| 29 // because this code is never reached as a result of a single click. | |
| 30 // TODO(pkotwicz): Fix this. http://crbug.com/437125 | |
| 31 multi_window_resize_controller_.Hide(); | |
| 32 } | 27 } |
| 33 } | 28 } |
| 34 | 29 |
| 35 } // namespace ash | 30 } // namespace ash |
| OLD | NEW |