OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <cstring> | 9 #include <cstring> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "ash/ash_switches.h" | 13 #include "ash/ash_switches.h" |
14 #include "ash/launcher/launcher.h" | 14 #include "ash/launcher/launcher.h" |
15 #include "ash/launcher/launcher_types.h" | 15 #include "ash/launcher/launcher_types.h" |
16 #include "ash/root_window_controller.h" | 16 #include "ash/root_window_controller.h" |
17 #include "ash/screen_ash.h" | 17 #include "ash/screen_ash.h" |
18 #include "ash/session_state_delegate.h" | 18 #include "ash/session_state_delegate.h" |
19 #include "ash/shelf/shelf_bezel_event_filter.h" | 19 #include "ash/shelf/shelf_bezel_event_filter.h" |
20 #include "ash/shelf/shelf_layout_manager_observer.h" | 20 #include "ash/shelf/shelf_layout_manager_observer.h" |
21 #include "ash/shelf/shelf_widget.h" | 21 #include "ash/shelf/shelf_widget.h" |
22 #include "ash/shell.h" | 22 #include "ash/shell.h" |
23 #include "ash/shell_window_ids.h" | 23 #include "ash/shell_window_ids.h" |
24 #include "ash/system/status_area_widget.h" | 24 #include "ash/system/status_area_widget.h" |
25 #include "ash/wm/gestures/shelf_gesture_handler.h" | 25 #include "ash/wm/gestures/shelf_gesture_handler.h" |
26 #include "ash/wm/mru_window_tracker.h" | 26 #include "ash/wm/mru_window_tracker.h" |
27 #include "ash/wm/property_util.h" | 27 #include "ash/wm/property_util.h" |
| 28 #include "ash/wm/window_animations.h" |
28 #include "ash/wm/window_properties.h" | 29 #include "ash/wm/window_properties.h" |
29 #include "ash/wm/window_util.h" | 30 #include "ash/wm/window_util.h" |
30 #include "ash/wm/workspace/workspace_animations.h" | |
31 #include "ash/wm/workspace_controller.h" | 31 #include "ash/wm/workspace_controller.h" |
32 #include "base/auto_reset.h" | 32 #include "base/auto_reset.h" |
33 #include "base/command_line.h" | 33 #include "base/command_line.h" |
34 #include "base/command_line.h" | 34 #include "base/command_line.h" |
35 #include "base/i18n/rtl.h" | 35 #include "base/i18n/rtl.h" |
36 #include "base/strings/string_number_conversions.h" | 36 #include "base/strings/string_number_conversions.h" |
37 #include "base/strings/string_util.h" | 37 #include "base/strings/string_util.h" |
38 #include "ui/aura/client/activation_client.h" | 38 #include "ui/aura/client/activation_client.h" |
39 #include "ui/aura/root_window.h" | 39 #include "ui/aura/root_window.h" |
40 #include "ui/base/events/event.h" | 40 #include "ui/base/events/event.h" |
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 BackgroundAnimator::CHANGE_IMMEDIATE : BackgroundAnimator::CHANGE_ANIMATE; | 592 BackgroundAnimator::CHANGE_IMMEDIATE : BackgroundAnimator::CHANGE_ANIMATE; |
593 | 593 |
594 State old_state = state_; | 594 State old_state = state_; |
595 state_ = state; | 595 state_ = state; |
596 TargetBounds target_bounds; | 596 TargetBounds target_bounds; |
597 CalculateTargetBounds(state_, &target_bounds); | 597 CalculateTargetBounds(state_, &target_bounds); |
598 | 598 |
599 ui::ScopedLayerAnimationSettings launcher_animation_setter( | 599 ui::ScopedLayerAnimationSettings launcher_animation_setter( |
600 GetLayer(shelf_)->GetAnimator()); | 600 GetLayer(shelf_)->GetAnimator()); |
601 launcher_animation_setter.SetTransitionDuration( | 601 launcher_animation_setter.SetTransitionDuration( |
602 base::TimeDelta::FromMilliseconds(kWorkspaceSwitchTimeMS)); | 602 base::TimeDelta::FromMilliseconds(kCrossFadeDurationMS)); |
603 launcher_animation_setter.SetTweenType(ui::Tween::EASE_OUT); | 603 launcher_animation_setter.SetTweenType(ui::Tween::EASE_OUT); |
604 launcher_animation_setter.SetPreemptionStrategy( | 604 launcher_animation_setter.SetPreemptionStrategy( |
605 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); | 605 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
606 GetLayer(shelf_)->SetBounds( | 606 GetLayer(shelf_)->SetBounds( |
607 target_bounds.shelf_bounds_in_root); | 607 target_bounds.shelf_bounds_in_root); |
608 GetLayer(shelf_)->SetOpacity(target_bounds.opacity); | 608 GetLayer(shelf_)->SetOpacity(target_bounds.opacity); |
609 ui::ScopedLayerAnimationSettings status_animation_setter( | 609 ui::ScopedLayerAnimationSettings status_animation_setter( |
610 GetLayer(shelf_->status_area_widget())->GetAnimator()); | 610 GetLayer(shelf_->status_area_widget())->GetAnimator()); |
611 status_animation_setter.SetTransitionDuration( | 611 status_animation_setter.SetTransitionDuration( |
612 base::TimeDelta::FromMilliseconds(kWorkspaceSwitchTimeMS)); | 612 base::TimeDelta::FromMilliseconds(kCrossFadeDurationMS)); |
613 status_animation_setter.SetTweenType(ui::Tween::EASE_OUT); | 613 status_animation_setter.SetTweenType(ui::Tween::EASE_OUT); |
614 status_animation_setter.SetPreemptionStrategy( | 614 status_animation_setter.SetPreemptionStrategy( |
615 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); | 615 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
616 | 616 |
617 // Delay updating the background when going from SHELF_AUTO_HIDE_SHOWN to | 617 // Delay updating the background when going from SHELF_AUTO_HIDE_SHOWN to |
618 // SHELF_AUTO_HIDE_HIDDEN until the shelf animates out. Otherwise during the | 618 // SHELF_AUTO_HIDE_HIDDEN until the shelf animates out. Otherwise during the |
619 // animation you see the background change. | 619 // animation you see the background change. |
620 // Also delay the animation when the shelf was hidden, and has just been made | 620 // Also delay the animation when the shelf was hidden, and has just been made |
621 // visible (e.g. using a gesture-drag). | 621 // visible (e.g. using a gesture-drag). |
622 // But do not delay if the transition happens when a window is maximized. | 622 // But do not delay if the transition happens when a window is maximized. |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 return gfx::Insets(0, distance, 0, 0); | 1020 return gfx::Insets(0, distance, 0, 0); |
1021 case SHELF_ALIGNMENT_TOP: | 1021 case SHELF_ALIGNMENT_TOP: |
1022 return gfx::Insets(0, 0, distance, 0); | 1022 return gfx::Insets(0, 0, distance, 0); |
1023 } | 1023 } |
1024 NOTREACHED(); | 1024 NOTREACHED(); |
1025 return gfx::Insets(); | 1025 return gfx::Insets(); |
1026 } | 1026 } |
1027 | 1027 |
1028 } // namespace internal | 1028 } // namespace internal |
1029 } // namespace ash | 1029 } // namespace ash |
OLD | NEW |