| 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/metrics/user_metrics_recorder.h" | 9 #include "ash/metrics/user_metrics_recorder.h" |
| 10 #include "ash/screen_util.h" | 10 #include "ash/screen_util.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 // gesture could be used to activate the window. | 291 // gesture could be used to activate the window. |
| 292 event->SetHandled(); | 292 event->SetHandled(); |
| 293 window_selector_->SelectWindow(target); | 293 window_selector_->SelectWindow(target); |
| 294 } | 294 } |
| 295 | 295 |
| 296 aura::Window* WindowOverview::GetEventTarget(ui::LocatedEvent* event) { | 296 aura::Window* WindowOverview::GetEventTarget(ui::LocatedEvent* event) { |
| 297 aura::Window* target = static_cast<aura::Window*>(event->target()); | 297 aura::Window* target = static_cast<aura::Window*>(event->target()); |
| 298 // If the target window doesn't actually contain the event location (i.e. | 298 // If the target window doesn't actually contain the event location (i.e. |
| 299 // mouse down over the window and mouse up elsewhere) then do not select the | 299 // mouse down over the window and mouse up elsewhere) then do not select the |
| 300 // window. | 300 // window. |
| 301 if (!target->HitTest(event->location())) | 301 if (!target->ContainsPoint(event->location())) |
| 302 return NULL; | 302 return NULL; |
| 303 | 303 |
| 304 return GetTargetedWindow(target); | 304 return GetTargetedWindow(target); |
| 305 } | 305 } |
| 306 | 306 |
| 307 aura::Window* WindowOverview::GetTargetedWindow(aura::Window* window) { | 307 aura::Window* WindowOverview::GetTargetedWindow(aura::Window* window) { |
| 308 for (WindowSelectorItemList::iterator iter = windows_->begin(); | 308 for (WindowSelectorItemList::iterator iter = windows_->begin(); |
| 309 iter != windows_->end(); ++iter) { | 309 iter != windows_->end(); ++iter) { |
| 310 aura::Window* selected = (*iter)->TargetedWindow(window); | 310 aura::Window* selected = (*iter)->TargetedWindow(window); |
| 311 if (selected) | 311 if (selected) |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 } | 447 } |
| 448 | 448 |
| 449 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { | 449 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { |
| 450 gfx::Rect bounds((*windows_)[index]->bounds()); | 450 gfx::Rect bounds((*windows_)[index]->bounds()); |
| 451 bounds.Inset(-kWindowOverviewSelectionPadding, | 451 bounds.Inset(-kWindowOverviewSelectionPadding, |
| 452 -kWindowOverviewSelectionPadding); | 452 -kWindowOverviewSelectionPadding); |
| 453 return bounds; | 453 return bounds; |
| 454 } | 454 } |
| 455 | 455 |
| 456 } // namespace ash | 456 } // namespace ash |
| OLD | NEW |