| 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/screen_util.h" | 7 #include "ash/screen_util.h" |
| 8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
| 9 #include "ash/shelf/shelf_constants.h" | 9 #include "ash/shelf/shelf_constants.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // Transitions to |visible_background_type_| if the widget is visible and to | 155 // Transitions to |visible_background_type_| if the widget is visible and to |
| 156 // SHELF_BACKGROUND_DEFAULT if it is not. | 156 // SHELF_BACKGROUND_DEFAULT if it is not. |
| 157 void UpdateBackground() { | 157 void UpdateBackground() { |
| 158 ShelfBackgroundType background_type = IsVisible() ? | 158 ShelfBackgroundType background_type = IsVisible() ? |
| 159 visible_background_type_ : SHELF_BACKGROUND_DEFAULT; | 159 visible_background_type_ : SHELF_BACKGROUND_DEFAULT; |
| 160 BackgroundAnimatorChangeType change_type = IsVisible() ? | 160 BackgroundAnimatorChangeType change_type = IsVisible() ? |
| 161 visible_background_change_type_ : BACKGROUND_CHANGE_IMMEDIATE; | 161 visible_background_change_type_ : BACKGROUND_CHANGE_IMMEDIATE; |
| 162 | 162 |
| 163 float target_opacity = | 163 float target_opacity = |
| 164 (background_type == SHELF_BACKGROUND_MAXIMIZED) ? 1.0f : 0.0f; | 164 (background_type == SHELF_BACKGROUND_MAXIMIZED) ? 1.0f : 0.0f; |
| 165 scoped_ptr<ui::ScopedLayerAnimationSettings> opaque_background_animation; | 165 std::unique_ptr<ui::ScopedLayerAnimationSettings> |
| 166 opaque_background_animation; |
| 166 if (change_type != BACKGROUND_CHANGE_IMMEDIATE) { | 167 if (change_type != BACKGROUND_CHANGE_IMMEDIATE) { |
| 167 opaque_background_animation.reset(new ui::ScopedLayerAnimationSettings( | 168 opaque_background_animation.reset(new ui::ScopedLayerAnimationSettings( |
| 168 opaque_background_.GetAnimator())); | 169 opaque_background_.GetAnimator())); |
| 169 opaque_background_animation->SetTransitionDuration( | 170 opaque_background_animation->SetTransitionDuration( |
| 170 base::TimeDelta::FromMilliseconds(kTimeToSwitchBackgroundMs)); | 171 base::TimeDelta::FromMilliseconds(kTimeToSwitchBackgroundMs)); |
| 171 } | 172 } |
| 172 opaque_background_.SetOpacity(target_opacity); | 173 opaque_background_.SetOpacity(target_opacity); |
| 173 | 174 |
| 174 // TODO(varkha): use ui::Layer on both opaque_background and normal | 175 // TODO(varkha): use ui::Layer on both opaque_background and normal |
| 175 // background retire background_animator_ at all. It would be simpler. | 176 // background retire background_animator_ at all. It would be simpler. |
| (...skipping 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1358 | 1359 |
| 1359 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( | 1360 void DockedWindowLayoutManager::OnKeyboardBoundsChanging( |
| 1360 const gfx::Rect& keyboard_bounds) { | 1361 const gfx::Rect& keyboard_bounds) { |
| 1361 // This bounds change will have caused a change to the Shelf which does not | 1362 // This bounds change will have caused a change to the Shelf which does not |
| 1362 // propagate automatically to this class, so manually recalculate bounds. | 1363 // propagate automatically to this class, so manually recalculate bounds. |
| 1363 Relayout(); | 1364 Relayout(); |
| 1364 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); | 1365 UpdateDockBounds(DockedWindowLayoutManagerObserver::KEYBOARD_BOUNDS_CHANGING); |
| 1365 } | 1366 } |
| 1366 | 1367 |
| 1367 } // namespace ash | 1368 } // namespace ash |
| OLD | NEW |