OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/wm/window_overview_mode.h" | 5 #include "athena/wm/window_overview_mode.h" |
6 | 6 |
7 #include <complex> | 7 #include <complex> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "athena/wm/overview_toolbar.h" | 10 #include "athena/wm/overview_toolbar.h" |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 while (!targeter && window->GetParentTarget()) { | 423 while (!targeter && window->GetParentTarget()) { |
424 window = window->GetParentTarget(); | 424 window = window->GetParentTarget(); |
425 targeter = window->GetEventTargeter(); | 425 targeter = window->GetEventTargeter(); |
426 } | 426 } |
427 if (!targeter) | 427 if (!targeter) |
428 return NULL; | 428 return NULL; |
429 aura::Window* target = static_cast<aura::Window*>( | 429 aura::Window* target = static_cast<aura::Window*>( |
430 targeter->FindTargetForLocatedEvent(container_, event)); | 430 targeter->FindTargetForLocatedEvent(container_, event)); |
431 while (target && target->parent() != container_) | 431 while (target && target->parent() != container_) |
432 target = target->parent(); | 432 target = target->parent(); |
433 aura::Window* transient_parent = wm::GetTransientParent(target); | 433 aura::Window* transient_parent = |
| 434 target ? wm::GetTransientParent(target) : NULL; |
434 return transient_parent ? transient_parent : target; | 435 return transient_parent ? transient_parent : target; |
435 } | 436 } |
436 | 437 |
437 // Scroll the window list by |delta_y| amount. |delta_y| is negative when | 438 // Scroll the window list by |delta_y| amount. |delta_y| is negative when |
438 // scrolling up; and positive when scrolling down. | 439 // scrolling up; and positive when scrolling down. |
439 void DoScroll(float delta_y) { | 440 void DoScroll(float delta_y) { |
440 const float kEpsilon = 1e-3f; | 441 const float kEpsilon = 1e-3f; |
441 float delta_y_p = std::abs(delta_y) / GetScrollableHeight(); | 442 float delta_y_p = std::abs(delta_y) / GetScrollableHeight(); |
442 const aura::Window::Windows& windows = | 443 const aura::Window::Windows& windows = |
443 window_list_provider_->GetWindowList(); | 444 window_list_provider_->GetWindowList(); |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 aura::Window* container, | 859 aura::Window* container, |
859 WindowListProvider* window_list_provider, | 860 WindowListProvider* window_list_provider, |
860 SplitViewController* split_view_controller, | 861 SplitViewController* split_view_controller, |
861 WindowOverviewModeDelegate* delegate) { | 862 WindowOverviewModeDelegate* delegate) { |
862 return scoped_ptr<WindowOverviewMode>( | 863 return scoped_ptr<WindowOverviewMode>( |
863 new WindowOverviewModeImpl(container, window_list_provider, | 864 new WindowOverviewModeImpl(container, window_list_provider, |
864 split_view_controller, delegate)); | 865 split_view_controller, delegate)); |
865 } | 866 } |
866 | 867 |
867 } // namespace athena | 868 } // namespace athena |
OLD | NEW |