| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 | 316 |
| 317 void WindowOverview::OnDisplayRemoved(const gfx::Display& display) { | 317 void WindowOverview::OnDisplayRemoved(const gfx::Display& display) { |
| 318 } | 318 } |
| 319 | 319 |
| 320 aura::Window* WindowOverview::GetEventTarget(ui::LocatedEvent* event) { | 320 aura::Window* WindowOverview::GetEventTarget(ui::LocatedEvent* event) { |
| 321 aura::Window* target = static_cast<aura::Window*>(event->target()); | 321 aura::Window* target = static_cast<aura::Window*>(event->target()); |
| 322 // If the target window doesn't actually contain the event location (i.e. | 322 // If the target window doesn't actually contain the event location (i.e. |
| 323 // mouse down over the window and mouse up elsewhere) then do not select the | 323 // mouse down over the window and mouse up elsewhere) then do not select the |
| 324 // window. | 324 // window. |
| 325 if (!target->ContainsPoint(event->location())) | 325 if (!target->ContainsPoint(gfx::ToFlooredPoint(event->location()))) |
| 326 return NULL; | 326 return NULL; |
| 327 | 327 |
| 328 return GetTargetedWindow(target); | 328 return GetTargetedWindow(target); |
| 329 } | 329 } |
| 330 | 330 |
| 331 aura::Window* WindowOverview::GetTargetedWindow(aura::Window* window) { | 331 aura::Window* WindowOverview::GetTargetedWindow(aura::Window* window) { |
| 332 for (WindowSelectorItemList::iterator iter = windows_->begin(); | 332 for (WindowSelectorItemList::iterator iter = windows_->begin(); |
| 333 iter != windows_->end(); ++iter) { | 333 iter != windows_->end(); ++iter) { |
| 334 aura::Window* selected = (*iter)->TargetedWindow(window); | 334 aura::Window* selected = (*iter)->TargetedWindow(window); |
| 335 if (selected) | 335 if (selected) |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 } | 474 } |
| 475 | 475 |
| 476 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { | 476 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { |
| 477 gfx::Rect bounds((*windows_)[index]->bounds()); | 477 gfx::Rect bounds((*windows_)[index]->bounds()); |
| 478 bounds.Inset(-kWindowOverviewSelectionPadding, | 478 bounds.Inset(-kWindowOverviewSelectionPadding, |
| 479 -kWindowOverviewSelectionPadding); | 479 -kWindowOverviewSelectionPadding); |
| 480 return bounds; | 480 return bounds; |
| 481 } | 481 } |
| 482 | 482 |
| 483 } // namespace ash | 483 } // namespace ash |
| OLD | NEW |