| 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/aura_shell/launcher/launcher.h" |
| 11 #include "ui/aura_shell/shell.h" |
| 10 #include "ui/gfx/compositor/layer.h" | 12 #include "ui/gfx/compositor/layer.h" |
| 11 #include "ui/gfx/compositor/layer_animator.h" | 13 #include "ui/gfx/compositor/layer_animator.h" |
| 12 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
| 13 | 15 |
| 14 namespace aura_shell { | 16 namespace aura_shell { |
| 15 namespace internal { | 17 namespace internal { |
| 16 | 18 |
| 17 namespace { | 19 namespace { |
| 18 | 20 |
| 19 ui::Layer* GetLayer(views::Widget* widget) { | 21 ui::Layer* GetLayer(views::Widget* widget) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 47 void ShelfLayoutManager::LayoutShelf() { | 49 void ShelfLayoutManager::LayoutShelf() { |
| 48 AutoReset<bool> auto_reset_in_layout(&in_layout_, true); | 50 AutoReset<bool> auto_reset_in_layout(&in_layout_, true); |
| 49 StopAnimating(); | 51 StopAnimating(); |
| 50 TargetBounds target_bounds; | 52 TargetBounds target_bounds; |
| 51 float target_opacity = visible_ ? 1.0f : 0.0f; | 53 float target_opacity = visible_ ? 1.0f : 0.0f; |
| 52 CalculateTargetBounds(visible_, &target_bounds); | 54 CalculateTargetBounds(visible_, &target_bounds); |
| 53 GetLayer(launcher_)->SetOpacity(target_opacity); | 55 GetLayer(launcher_)->SetOpacity(target_opacity); |
| 54 GetLayer(status_)->SetOpacity(target_opacity); | 56 GetLayer(status_)->SetOpacity(target_opacity); |
| 55 launcher_->SetBounds(target_bounds.launcher_bounds); | 57 launcher_->SetBounds(target_bounds.launcher_bounds); |
| 56 status_->SetBounds(target_bounds.status_bounds); | 58 status_->SetBounds(target_bounds.status_bounds); |
| 59 Shell::GetInstance()->launcher()->SetStatusWidth( |
| 60 target_bounds.status_bounds.width()); |
| 57 aura::RootWindow::GetInstance()->screen()->set_work_area_insets( | 61 aura::RootWindow::GetInstance()->screen()->set_work_area_insets( |
| 58 target_bounds.work_area_insets); | 62 target_bounds.work_area_insets); |
| 59 } | 63 } |
| 60 | 64 |
| 61 void ShelfLayoutManager::SetVisible(bool visible) { | 65 void ShelfLayoutManager::SetVisible(bool visible) { |
| 62 bool current_visibility = animating_ ? !visible_ : visible_; | 66 bool current_visibility = animating_ ? !visible_ : visible_; |
| 63 if (visible == current_visibility) | 67 if (visible == current_visibility) |
| 64 return; // Nothing changed. | 68 return; // Nothing changed. |
| 65 | 69 |
| 66 StopAnimating(); | 70 StopAnimating(); |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 animating_ = false; | 150 animating_ = false; |
| 147 visible_ = !visible_; | 151 visible_ = !visible_; |
| 148 TargetBounds target_bounds; | 152 TargetBounds target_bounds; |
| 149 CalculateTargetBounds(visible_, &target_bounds); | 153 CalculateTargetBounds(visible_, &target_bounds); |
| 150 aura::RootWindow::GetInstance()->screen()->set_work_area_insets( | 154 aura::RootWindow::GetInstance()->screen()->set_work_area_insets( |
| 151 target_bounds.work_area_insets); | 155 target_bounds.work_area_insets); |
| 152 } | 156 } |
| 153 | 157 |
| 154 } // internal | 158 } // internal |
| 155 } // aura_shell | 159 } // aura_shell |
| OLD | NEW |