Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/dock/docked_window_layout_manager.h" | 5 #include "ash/wm/dock/docked_window_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
| 9 #include "ash/screen_ash.h" | 9 #include "ash/screen_ash.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 594 const gfx::Rect& new_bounds) { | 594 const gfx::Rect& new_bounds) { |
| 595 // Only relayout if the dragged window would get docked. | 595 // Only relayout if the dragged window would get docked. |
| 596 if (window == dragged_window_ && is_dragged_window_docked_) | 596 if (window == dragged_window_ && is_dragged_window_docked_) |
| 597 Relayout(); | 597 Relayout(); |
| 598 } | 598 } |
| 599 | 599 |
| 600 void DockedWindowLayoutManager::OnWindowVisibilityChanging( | 600 void DockedWindowLayoutManager::OnWindowVisibilityChanging( |
| 601 aura::Window* window, bool visible) { | 601 aura::Window* window, bool visible) { |
| 602 if (IsPopupOrTransient(window)) | 602 if (IsPopupOrTransient(window)) |
| 603 return; | 603 return; |
| 604 int animation_type = WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE; | 604 int animation_type = views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT; |
| 605 if (!visible && wm::GetWindowState(window)->IsMinimized()) | |
| 606 animation_type = WINDOW_VISIBILITY_ANIMATION_TYPE_MINIMIZE; | |
| 605 if (visible) { | 607 if (visible) { |
| 606 animation_type = views::corewm::WINDOW_VISIBILITY_ANIMATION_TYPE_DEFAULT; | |
| 607 views::corewm::SetWindowVisibilityAnimationDuration( | 608 views::corewm::SetWindowVisibilityAnimationDuration( |
| 608 window, base::TimeDelta::FromMilliseconds(kFadeDurationMs)); | 609 window, base::TimeDelta::FromMilliseconds(kFadeDurationMs)); |
|
pkotwicz
2013/11/11 18:10:51
You should be explicit about the animation type yo
varkha
2013/11/11 20:18:30
Done (I think). This is matching the type set in G
| |
| 609 } | 610 } |
| 610 views::corewm::SetWindowVisibilityAnimationType(window, animation_type); | 611 views::corewm::SetWindowVisibilityAnimationType(window, animation_type); |
| 611 } | 612 } |
| 612 | 613 |
| 613 void DockedWindowLayoutManager::OnWindowDestroying(aura::Window* window) { | 614 void DockedWindowLayoutManager::OnWindowDestroying(aura::Window* window) { |
| 614 if (dragged_window_ == window) { | 615 if (dragged_window_ == window) { |
| 615 FinishDragging(DOCKED_ACTION_NONE, DOCKED_ACTION_SOURCE_UNKNOWN); | 616 FinishDragging(DOCKED_ACTION_NONE, DOCKED_ACTION_SOURCE_UNKNOWN); |
| 616 DCHECK(!dragged_window_); | 617 DCHECK(!dragged_window_); |
| 617 DCHECK (!is_dragged_window_docked_); | 618 DCHECK (!is_dragged_window_docked_); |
| 618 } | 619 } |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1070 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( | 1071 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( |
| 1071 const gfx::Rect& keyboard_bounds) { | 1072 const gfx::Rect& keyboard_bounds) { |
| 1072 // This bounds change will have caused a change to the Shelf which does not | 1073 // This bounds change will have caused a change to the Shelf which does not |
| 1073 // propagate automatically to this class, so manually recalculate bounds. | 1074 // propagate automatically to this class, so manually recalculate bounds. |
| 1074 Relayout(); | 1075 Relayout(); |
| 1075 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1076 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
| 1076 } | 1077 } |
| 1077 | 1078 |
| 1078 } // namespace internal | 1079 } // namespace internal |
| 1079 } // namespace ash | 1080 } // namespace ash |
| OLD | NEW |