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_selector.h" | 5 #include "ash/wm/overview/window_selector.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/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 | 318 |
319 // TODO(flackr): StopPropogation prevents generation of gesture events. | 319 // TODO(flackr): StopPropogation prevents generation of gesture events. |
320 // We should find a better way to prevent events from being delivered to | 320 // We should find a better way to prevent events from being delivered to |
321 // the window, perhaps a transparent window in front of the target window | 321 // the window, perhaps a transparent window in front of the target window |
322 // or using EventClientImpl::CanProcessEventsWithinSubtree and then a tap | 322 // or using EventClientImpl::CanProcessEventsWithinSubtree and then a tap |
323 // gesture could be used to activate the window. | 323 // gesture could be used to activate the window. |
324 event->SetHandled(); | 324 event->SetHandled(); |
325 SelectWindow(target); | 325 SelectWindow(target); |
326 } | 326 } |
327 | 327 |
328 void WindowSelector::OnDisplayBoundsChanged(const gfx::Display& display) { | |
329 PositionWindows(/* animate */ false); | |
330 } | |
331 | |
332 void WindowSelector::OnDisplayAdded(const gfx::Display& display) { | 328 void WindowSelector::OnDisplayAdded(const gfx::Display& display) { |
333 } | 329 } |
334 | 330 |
335 void WindowSelector::OnDisplayRemoved(const gfx::Display& display) { | 331 void WindowSelector::OnDisplayRemoved(const gfx::Display& display) { |
336 } | 332 } |
337 | 333 |
| 334 void WindowSelector::OnDisplayMetricsChanged(const gfx::Display& display, |
| 335 uint32_t metrics) { |
| 336 PositionWindows(/* animate */ false); |
| 337 } |
| 338 |
338 void WindowSelector::OnWindowAdded(aura::Window* new_window) { | 339 void WindowSelector::OnWindowAdded(aura::Window* new_window) { |
339 if (new_window->type() != ui::wm::WINDOW_TYPE_NORMAL && | 340 if (new_window->type() != ui::wm::WINDOW_TYPE_NORMAL && |
340 new_window->type() != ui::wm::WINDOW_TYPE_PANEL) { | 341 new_window->type() != ui::wm::WINDOW_TYPE_PANEL) { |
341 return; | 342 return; |
342 } | 343 } |
343 | 344 |
344 for (size_t i = 0; i < kSwitchableWindowContainerIdsLength; ++i) { | 345 for (size_t i = 0; i < kSwitchableWindowContainerIdsLength; ++i) { |
345 if (new_window->parent()->id() == kSwitchableWindowContainerIds[i] && | 346 if (new_window->parent()->id() == kSwitchableWindowContainerIds[i] && |
346 !::wm::GetTransientParent(new_window)) { | 347 !::wm::GetTransientParent(new_window)) { |
347 // The new window is in one of the switchable containers, abort overview. | 348 // The new window is in one of the switchable containers, abort overview. |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 for (WindowSelectorItemList::iterator iter = windows_.begin(); | 575 for (WindowSelectorItemList::iterator iter = windows_.begin(); |
575 iter != windows_.end(); ++iter) { | 576 iter != windows_.end(); ++iter) { |
576 aura::Window* selected = (*iter)->TargetedWindow(window); | 577 aura::Window* selected = (*iter)->TargetedWindow(window); |
577 if (selected) | 578 if (selected) |
578 return selected; | 579 return selected; |
579 } | 580 } |
580 return NULL; | 581 return NULL; |
581 } | 582 } |
582 | 583 |
583 } // namespace ash | 584 } // namespace ash |
OLD | NEW |