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/shelf/shelf_layout_manager.h" | 5 #include "ash/shelf/shelf_layout_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <cstring> | 9 #include <cstring> |
10 #include <string> | 10 #include <string> |
(...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 bounds->Inset(SelectValueForShelfAlignment( | 731 bounds->Inset(SelectValueForShelfAlignment( |
732 gfx::Insets(0, 0, inset, 0), | 732 gfx::Insets(0, 0, inset, 0), |
733 gfx::Insets(0, inset, 0, 0), | 733 gfx::Insets(0, inset, 0, 0), |
734 gfx::Insets(0, 0, 0, inset), | 734 gfx::Insets(0, 0, 0, inset), |
735 gfx::Insets(inset, 0, 0, 0))); | 735 gfx::Insets(inset, 0, 0, 0))); |
736 } | 736 } |
737 | 737 |
738 void ShelfLayoutManager::CalculateTargetBounds( | 738 void ShelfLayoutManager::CalculateTargetBounds( |
739 const State& state, | 739 const State& state, |
740 TargetBounds* target_bounds) { | 740 TargetBounds* target_bounds) { |
741 const gfx::Rect available_bounds(root_window_->bounds()); | 741 gfx::Rect available_bounds = |
| 742 ScreenUtil::GetShelfDisplayBoundsInScreen(root_window_); |
| 743 available_bounds = |
| 744 ScreenUtil::ConvertRectFromScreen(root_window_, available_bounds); |
| 745 |
742 gfx::Rect status_size( | 746 gfx::Rect status_size( |
743 shelf_->status_area_widget()->GetWindowBoundsInScreen().size()); | 747 shelf_->status_area_widget()->GetWindowBoundsInScreen().size()); |
744 int shelf_width = 0, shelf_height = 0; | 748 int shelf_width = 0, shelf_height = 0; |
745 GetShelfSize(&shelf_width, &shelf_height); | 749 GetShelfSize(&shelf_width, &shelf_height); |
746 if (IsHorizontalAlignment()) | 750 if (IsHorizontalAlignment()) |
747 shelf_width = available_bounds.width(); | 751 shelf_width = available_bounds.width(); |
748 else | 752 else |
749 shelf_height = available_bounds.height(); | 753 shelf_height = available_bounds.height(); |
750 | 754 |
751 if (state.visibility_state == SHELF_AUTO_HIDE && | 755 if (state.visibility_state == SHELF_AUTO_HIDE && |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 return false; | 1181 return false; |
1178 } | 1182 } |
1179 if (session_state_delegate->IsUserSessionBlocked() || | 1183 if (session_state_delegate->IsUserSessionBlocked() || |
1180 state_.is_adding_user_screen) { | 1184 state_.is_adding_user_screen) { |
1181 return true; | 1185 return true; |
1182 } | 1186 } |
1183 return false; | 1187 return false; |
1184 } | 1188 } |
1185 | 1189 |
1186 } // namespace ash | 1190 } // namespace ash |
OLD | NEW |