| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ash/wm/overview/window_overview.h" | 5 #include "ash/wm/overview/window_overview.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/accessibility_delegate.h" | 9 #include "ash/accessibility_delegate.h" |
| 10 #include "ash/metrics/user_metrics_recorder.h" | 10 #include "ash/metrics/user_metrics_recorder.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 | 291 |
| 292 // TODO(flackr): StopPropogation prevents generation of gesture events. | 292 // TODO(flackr): StopPropogation prevents generation of gesture events. |
| 293 // We should find a better way to prevent events from being delivered to | 293 // We should find a better way to prevent events from being delivered to |
| 294 // the window, perhaps a transparent window in front of the target window | 294 // the window, perhaps a transparent window in front of the target window |
| 295 // or using EventClientImpl::CanProcessEventsWithinSubtree and then a tap | 295 // or using EventClientImpl::CanProcessEventsWithinSubtree and then a tap |
| 296 // gesture could be used to activate the window. | 296 // gesture could be used to activate the window. |
| 297 event->SetHandled(); | 297 event->SetHandled(); |
| 298 window_selector_->SelectWindow(target); | 298 window_selector_->SelectWindow(target); |
| 299 } | 299 } |
| 300 | 300 |
| 301 void WindowOverview::OnDisplayBoundsChanged(const gfx::Display& display) { | |
| 302 PositionWindows(/* animate */ false); | |
| 303 } | |
| 304 | |
| 305 void WindowOverview::OnDisplayAdded(const gfx::Display& display) { | 301 void WindowOverview::OnDisplayAdded(const gfx::Display& display) { |
| 306 } | 302 } |
| 307 | 303 |
| 308 void WindowOverview::OnDisplayRemoved(const gfx::Display& display) { | 304 void WindowOverview::OnDisplayRemoved(const gfx::Display& display) { |
| 309 } | 305 } |
| 310 | 306 |
| 307 void WindowOverview::OnDisplayMetricsChanged( |
| 308 const gfx::Display& display, |
| 309 gfx::DisplayObserver::DisplayMetrics metrics) { |
| 310 PositionWindows(/* animate */ false); |
| 311 } |
| 312 |
| 311 aura::Window* WindowOverview::GetEventTarget(ui::LocatedEvent* event) { | 313 aura::Window* WindowOverview::GetEventTarget(ui::LocatedEvent* event) { |
| 312 aura::Window* target = static_cast<aura::Window*>(event->target()); | 314 aura::Window* target = static_cast<aura::Window*>(event->target()); |
| 313 // If the target window doesn't actually contain the event location (i.e. | 315 // If the target window doesn't actually contain the event location (i.e. |
| 314 // mouse down over the window and mouse up elsewhere) then do not select the | 316 // mouse down over the window and mouse up elsewhere) then do not select the |
| 315 // window. | 317 // window. |
| 316 if (!target->ContainsPoint(event->location())) | 318 if (!target->ContainsPoint(event->location())) |
| 317 return NULL; | 319 return NULL; |
| 318 | 320 |
| 319 return GetTargetedWindow(target); | 321 return GetTargetedWindow(target); |
| 320 } | 322 } |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 } | 450 } |
| 449 | 451 |
| 450 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { | 452 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { |
| 451 gfx::Rect bounds((*windows_)[index]->bounds()); | 453 gfx::Rect bounds((*windows_)[index]->bounds()); |
| 452 bounds.Inset(-kWindowOverviewSelectionPadding, | 454 bounds.Inset(-kWindowOverviewSelectionPadding, |
| 453 -kWindowOverviewSelectionPadding); | 455 -kWindowOverviewSelectionPadding); |
| 454 return bounds; | 456 return bounds; |
| 455 } | 457 } |
| 456 | 458 |
| 457 } // namespace ash | 459 } // namespace ash |
| OLD | NEW |