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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 | 123 |
124 void ShelfLayoutManager::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) { | 124 void ShelfLayoutManager::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) { |
125 if (auto_hide_behavior_ == behavior) | 125 if (auto_hide_behavior_ == behavior) |
126 return; | 126 return; |
127 auto_hide_behavior_ = behavior; | 127 auto_hide_behavior_ = behavior; |
128 UpdateVisibilityState(); | 128 UpdateVisibilityState(); |
129 } | 129 } |
130 | 130 |
131 bool ShelfLayoutManager::IsVisible() const { | 131 bool ShelfLayoutManager::IsVisible() const { |
132 return state_.visibility_state == VISIBLE || | 132 return status_->IsVisible() && (state_.visibility_state == VISIBLE || |
133 (state_.visibility_state == AUTO_HIDE && | 133 (state_.visibility_state == AUTO_HIDE && |
134 state_.auto_hide_state == AUTO_HIDE_SHOWN); | 134 state_.auto_hide_state == AUTO_HIDE_SHOWN)); |
135 } | 135 } |
136 | 136 |
137 gfx::Rect ShelfLayoutManager::GetMaximizedWindowBounds( | 137 gfx::Rect ShelfLayoutManager::GetMaximizedWindowBounds( |
138 aura::Window* window) const { | 138 aura::Window* window) const { |
139 // TODO: needs to be multi-mon aware. | 139 // TODO: needs to be multi-mon aware. |
140 gfx::Rect bounds(gfx::Screen::GetMonitorAreaNearestWindow(window)); | 140 gfx::Rect bounds(gfx::Screen::GetMonitorAreaNearestWindow(window)); |
141 if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT || | 141 if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT || |
142 auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) { | 142 auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) { |
143 bounds.set_height(bounds.height() - kAutoHideHeight); | 143 bounds.set_height(bounds.height() - kAutoHideHeight); |
144 return bounds; | 144 return bounds; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 insets.Set(kWorkspaceAreaBottomInset, 0, 0, 0); | 428 insets.Set(kWorkspaceAreaBottomInset, 0, 0, 0); |
429 } | 429 } |
430 if (launcher_widget() && launcher_widget()->GetNativeWindow()) | 430 if (launcher_widget() && launcher_widget()->GetNativeWindow()) |
431 launcher_widget()->GetNativeWindow()->set_hit_test_bounds_override_outer( | 431 launcher_widget()->GetNativeWindow()->set_hit_test_bounds_override_outer( |
432 insets); | 432 insets); |
433 status_->GetNativeWindow()->set_hit_test_bounds_override_outer(insets); | 433 status_->GetNativeWindow()->set_hit_test_bounds_override_outer(insets); |
434 } | 434 } |
435 | 435 |
436 } // namespace internal | 436 } // namespace internal |
437 } // namespace ash | 437 } // namespace ash |
OLD | NEW |