| 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 "ash/metrics/user_metrics_recorder.h" | 7 #include "ash/metrics/user_metrics_recorder.h" |
| 8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/touch/touch_uma.h" | 10 #include "ash/touch/touch_uma.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 multi_window_resize_controller_.Show(target, component, | 70 multi_window_resize_controller_.Show(target, component, |
| 71 event->location()); | 71 event->location()); |
| 72 break; | 72 break; |
| 73 } | 73 } |
| 74 case ui::ET_MOUSE_ENTERED: | 74 case ui::ET_MOUSE_ENTERED: |
| 75 break; | 75 break; |
| 76 case ui::ET_MOUSE_CAPTURE_CHANGED: | 76 case ui::ET_MOUSE_CAPTURE_CHANGED: |
| 77 case ui::ET_MOUSE_EXITED: | 77 case ui::ET_MOUSE_EXITED: |
| 78 break; | 78 break; |
| 79 case ui::ET_MOUSE_PRESSED: { | 79 case ui::ET_MOUSE_PRESSED: { |
| 80 // Maximize behavior is implemented as post-target handling so the target | |
| 81 // can cancel it. | |
| 82 if (ui::EventCanceledDefaultHandling(*event)) { | |
| 83 ToplevelWindowEventHandler::OnMouseEvent(event); | |
| 84 return; | |
| 85 } | |
| 86 wm::WindowState* target_state = wm::GetWindowState(target); | 80 wm::WindowState* target_state = wm::GetWindowState(target); |
| 87 if (event->flags() & ui::EF_IS_DOUBLE_CLICK && | 81 if (event->flags() & ui::EF_IS_DOUBLE_CLICK && |
| 88 event->IsOnlyLeftMouseButton() && | 82 event->IsOnlyLeftMouseButton() && |
| 89 target->delegate()->GetNonClientComponent(event->location()) == | 83 target->delegate()->GetNonClientComponent(event->location()) == |
| 90 HTCAPTION) { | 84 HTCAPTION) { |
| 91 ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction( | 85 ash::Shell::GetInstance()->metrics()->RecordUserMetricsAction( |
| 92 ash::UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK); | 86 ash::UMA_TOGGLE_MAXIMIZE_CAPTION_CLICK); |
| 93 ToggleMaximizedState(target_state); | 87 ToggleMaximizedState(target_state); |
| 94 } | 88 } |
| 95 multi_window_resize_controller_.Hide(); | 89 multi_window_resize_controller_.Hide(); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 origin.y(), | 165 origin.y(), |
| 172 work_area.width(), | 166 work_area.width(), |
| 173 target->bounds().height())); | 167 target->bounds().height())); |
| 174 } | 168 } |
| 175 } | 169 } |
| 176 } | 170 } |
| 177 } | 171 } |
| 178 | 172 |
| 179 } // namespace internal | 173 } // namespace internal |
| 180 } // namespace ash | 174 } // namespace ash |
| OLD | NEW |