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 bool empty = status_->GetWindowScreenBounds().IsEmpty() && |
sky
2012/04/09 21:01:48
Can we use status_->IsVisible() instead? Also, I t
sadrul
2012/04/09 23:59:34
Changed to use status_->IsVisible. I have removed
| |
133 (launcher_widget()->GetWindowScreenBounds().IsEmpty() || | |
134 launcher_->GetStatusWidth() == 0); | |
135 return !empty && (state_.visibility_state == VISIBLE || | |
133 (state_.visibility_state == AUTO_HIDE && | 136 (state_.visibility_state == AUTO_HIDE && |
134 state_.auto_hide_state == AUTO_HIDE_SHOWN); | 137 state_.auto_hide_state == AUTO_HIDE_SHOWN)); |
135 } | 138 } |
136 | 139 |
137 gfx::Rect ShelfLayoutManager::GetMaximizedWindowBounds( | 140 gfx::Rect ShelfLayoutManager::GetMaximizedWindowBounds( |
138 aura::Window* window) const { | 141 aura::Window* window) const { |
139 // TODO: needs to be multi-mon aware. | 142 // TODO: needs to be multi-mon aware. |
140 gfx::Rect bounds(gfx::Screen::GetMonitorAreaNearestWindow(window)); | 143 gfx::Rect bounds(gfx::Screen::GetMonitorAreaNearestWindow(window)); |
141 if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT || | 144 if (auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_DEFAULT || |
142 auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) { | 145 auto_hide_behavior_ == SHELF_AUTO_HIDE_BEHAVIOR_ALWAYS) { |
143 bounds.set_height(bounds.height() - kAutoHideHeight); | 146 bounds.set_height(bounds.height() - kAutoHideHeight); |
144 return bounds; | 147 return bounds; |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
428 insets.Set(kWorkspaceAreaBottomInset, 0, 0, 0); | 431 insets.Set(kWorkspaceAreaBottomInset, 0, 0, 0); |
429 } | 432 } |
430 if (launcher_widget() && launcher_widget()->GetNativeWindow()) | 433 if (launcher_widget() && launcher_widget()->GetNativeWindow()) |
431 launcher_widget()->GetNativeWindow()->set_hit_test_bounds_override_outer( | 434 launcher_widget()->GetNativeWindow()->set_hit_test_bounds_override_outer( |
432 insets); | 435 insets); |
433 status_->GetNativeWindow()->set_hit_test_bounds_override_outer(insets); | 436 status_->GetNativeWindow()->set_hit_test_bounds_override_outer(insets); |
434 } | 437 } |
435 | 438 |
436 } // namespace internal | 439 } // namespace internal |
437 } // namespace ash | 440 } // namespace ash |
OLD | NEW |