| 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 <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 // takes care of setting the height properly. | 802 // takes care of setting the height properly. |
| 803 shelf_size = kShelfAutoHideSize; | 803 shelf_size = kShelfAutoHideSize; |
| 804 } else if (state.visibility_state == SHELF_HIDDEN || | 804 } else if (state.visibility_state == SHELF_HIDDEN || |
| 805 (!keyboard_bounds_.IsEmpty() && | 805 (!keyboard_bounds_.IsEmpty() && |
| 806 !keyboard::IsKeyboardOverscrollEnabled())) { | 806 !keyboard::IsKeyboardOverscrollEnabled())) { |
| 807 shelf_size = 0; | 807 shelf_size = 0; |
| 808 } | 808 } |
| 809 | 809 |
| 810 gfx::Rect available_bounds = | 810 gfx::Rect available_bounds = |
| 811 ScreenUtil::GetShelfDisplayBoundsInRoot(root_window_); | 811 ScreenUtil::GetShelfDisplayBoundsInRoot(root_window_); |
| 812 available_bounds.Inset(0, chromevox_panel_height_, 0, 0); |
| 812 int shelf_width = PrimaryAxisValue(available_bounds.width(), shelf_size); | 813 int shelf_width = PrimaryAxisValue(available_bounds.width(), shelf_size); |
| 813 int shelf_height = PrimaryAxisValue(shelf_size, available_bounds.height()); | 814 int shelf_height = PrimaryAxisValue(shelf_size, available_bounds.height()); |
| 814 int bottom_shelf_vertical_offset = available_bounds.bottom(); | 815 int bottom_shelf_vertical_offset = available_bounds.bottom(); |
| 815 if (keyboard_bounds_.IsEmpty()) | 816 if (keyboard_bounds_.IsEmpty()) |
| 816 bottom_shelf_vertical_offset -= shelf_height; | 817 bottom_shelf_vertical_offset -= shelf_height; |
| 817 else | 818 else |
| 818 bottom_shelf_vertical_offset -= keyboard_bounds_.height(); | 819 bottom_shelf_vertical_offset -= keyboard_bounds_.height(); |
| 819 | 820 |
| 820 gfx::Point shelf_origin = SelectValueForShelfAlignment( | 821 gfx::Point shelf_origin = SelectValueForShelfAlignment( |
| 821 gfx::Point(available_bounds.x(), bottom_shelf_vertical_offset), | 822 gfx::Point(available_bounds.x(), bottom_shelf_vertical_offset), |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 if (ash::MaterialDesignController::IsShelfMaterial()) { | 1185 if (ash::MaterialDesignController::IsShelfMaterial()) { |
| 1185 return (state.visibility_state == SHELF_AUTO_HIDE && | 1186 return (state.visibility_state == SHELF_AUTO_HIDE && |
| 1186 state.auto_hide_state == SHELF_AUTO_HIDE_SHOWN) | 1187 state.auto_hide_state == SHELF_AUTO_HIDE_SHOWN) |
| 1187 ? 1.0f | 1188 ? 1.0f |
| 1188 : 0.0f; | 1189 : 0.0f; |
| 1189 } | 1190 } |
| 1190 return (state.visibility_state == SHELF_AUTO_HIDE) ? 1.0f : 0.0f; | 1191 return (state.visibility_state == SHELF_AUTO_HIDE) ? 1.0f : 0.0f; |
| 1191 } | 1192 } |
| 1192 | 1193 |
| 1193 } // namespace ash | 1194 } // namespace ash |
| OLD | NEW |