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/wm/shelf_layout_manager.h" | 5 #include "ash/wm/shelf_layout_manager.h" |
6 | 6 |
7 #include "ash/launcher/launcher.h" | 7 #include "ash/launcher/launcher.h" |
8 #include "ash/screen_ash.h" | 8 #include "ash/screen_ash.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_delegate.h" | 10 #include "ash/shell_delegate.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 ShelfLayoutManager::~ShelfLayoutManager() { | 117 ShelfLayoutManager::~ShelfLayoutManager() { |
118 } | 118 } |
119 | 119 |
120 void ShelfLayoutManager::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) { | 120 void ShelfLayoutManager::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) { |
121 if (auto_hide_behavior_ == behavior) | 121 if (auto_hide_behavior_ == behavior) |
122 return; | 122 return; |
123 auto_hide_behavior_ = behavior; | 123 auto_hide_behavior_ = behavior; |
124 UpdateVisibilityState(); | 124 UpdateVisibilityState(); |
125 } | 125 } |
126 | 126 |
| 127 bool ShelfLayoutManager::IsVisible() const { |
| 128 return state_.visibility_state == VISIBLE || |
| 129 (state_.visibility_state == AUTO_HIDE && |
| 130 state_.auto_hide_state == AUTO_HIDE_SHOWN); |
| 131 } |
| 132 |
127 gfx::Rect ShelfLayoutManager::GetMaximizedWindowBounds( | 133 gfx::Rect ShelfLayoutManager::GetMaximizedWindowBounds( |
128 aura::Window* window) const { | 134 aura::Window* window) const { |
129 // TODO: needs to be multi-mon aware. | 135 // TODO: needs to be multi-mon aware. |
130 gfx::Rect bounds(gfx::Screen::GetMonitorAreaNearestWindow(window)); | 136 gfx::Rect bounds(gfx::Screen::GetMonitorAreaNearestWindow(window)); |
131 if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT || | 137 if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT || |
132 auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) { | 138 auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) { |
133 bounds.set_height(bounds.height() - kAutoHideHeight); | 139 bounds.set_height(bounds.height() - kAutoHideHeight); |
134 return bounds; | 140 return bounds; |
135 } | 141 } |
136 // SHELF_AUTO_HIDE_BEHAVIOR_NEVER maximized windows don't get any taller. | 142 // SHELF_AUTO_HIDE_BEHAVIOR_NEVER maximized windows don't get any taller. |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 insets.Set(kWorkspaceAreaBottomInset, 0, 0, 0); | 408 insets.Set(kWorkspaceAreaBottomInset, 0, 0, 0); |
403 } | 409 } |
404 if (launcher_widget() && launcher_widget()->GetNativeWindow()) | 410 if (launcher_widget() && launcher_widget()->GetNativeWindow()) |
405 launcher_widget()->GetNativeWindow()->set_hit_test_bounds_override_outer( | 411 launcher_widget()->GetNativeWindow()->set_hit_test_bounds_override_outer( |
406 insets); | 412 insets); |
407 status_->GetNativeWindow()->set_hit_test_bounds_override_outer(insets); | 413 status_->GetNativeWindow()->set_hit_test_bounds_override_outer(insets); |
408 } | 414 } |
409 | 415 |
410 } // namespace internal | 416 } // namespace internal |
411 } // namespace ash | 417 } // namespace ash |
OLD | NEW |