OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/aura_shell/shelf_layout_manager.h" | 5 #include "ui/aura_shell/shelf_layout_manager.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
9 #include "ui/aura/screen_aura.h" | 9 #include "ui/aura/screen_aura.h" |
10 #include "ui/gfx/compositor/layer.h" | 10 #include "ui/gfx/compositor/layer.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 const gfx::Rect& available_bounds(aura::RootWindow::GetInstance()->bounds()); | 115 const gfx::Rect& available_bounds(aura::RootWindow::GetInstance()->bounds()); |
116 int y = available_bounds.bottom() - (visible ? max_height_ : 0); | 116 int y = available_bounds.bottom() - (visible ? max_height_ : 0); |
117 gfx::Rect status_bounds(status_->GetWindowScreenBounds()); | 117 gfx::Rect status_bounds(status_->GetWindowScreenBounds()); |
118 target_bounds->status_bounds = gfx::Rect( | 118 target_bounds->status_bounds = gfx::Rect( |
119 available_bounds.right() - status_bounds.width(), | 119 available_bounds.right() - status_bounds.width(), |
120 y + (max_height_ - status_bounds.height()) / 2, | 120 y + (max_height_ - status_bounds.height()) / 2, |
121 status_bounds.width(), status_bounds.height()); | 121 status_bounds.width(), status_bounds.height()); |
122 gfx::Rect launcher_bounds(launcher_->GetWindowScreenBounds()); | 122 gfx::Rect launcher_bounds(launcher_->GetWindowScreenBounds()); |
123 target_bounds->launcher_bounds = gfx::Rect( | 123 target_bounds->launcher_bounds = gfx::Rect( |
124 available_bounds.x(), y + (max_height_ - launcher_bounds.height()) / 2, | 124 available_bounds.x(), y + (max_height_ - launcher_bounds.height()) / 2, |
125 available_bounds.width() - status_bounds.width(), | 125 available_bounds.width(), |
126 launcher_bounds.height()); | 126 launcher_bounds.height()); |
127 if (visible) | 127 if (visible) |
128 target_bounds->work_area_insets = gfx::Insets(0, 0, max_height_, 0); | 128 target_bounds->work_area_insets = gfx::Insets(0, 0, max_height_, 0); |
129 } | 129 } |
130 | 130 |
131 void ShelfLayoutManager::AnimateWidgetTo(views::Widget* widget, | 131 void ShelfLayoutManager::AnimateWidgetTo(views::Widget* widget, |
132 const gfx::Rect& target_bounds, | 132 const gfx::Rect& target_bounds, |
133 float target_opacity) { | 133 float target_opacity) { |
134 ui::Layer* layer = GetLayer(widget); | 134 ui::Layer* layer = GetLayer(widget); |
135 ui::LayerAnimator::ScopedSettings animation_setter(layer->GetAnimator()); | 135 ui::LayerAnimator::ScopedSettings animation_setter(layer->GetAnimator()); |
(...skipping 10 matching lines...) Expand all Loading... |
146 animating_ = false; | 146 animating_ = false; |
147 visible_ = !visible_; | 147 visible_ = !visible_; |
148 TargetBounds target_bounds; | 148 TargetBounds target_bounds; |
149 CalculateTargetBounds(visible_, &target_bounds); | 149 CalculateTargetBounds(visible_, &target_bounds); |
150 aura::RootWindow::GetInstance()->screen()->set_work_area_insets( | 150 aura::RootWindow::GetInstance()->screen()->set_work_area_insets( |
151 target_bounds.work_area_insets); | 151 target_bounds.work_area_insets); |
152 } | 152 } |
153 | 153 |
154 } // internal | 154 } // internal |
155 } // aura_shell | 155 } // aura_shell |
OLD | NEW |