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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 shelf_width += translate; | 885 shelf_width += translate; |
886 shelf_width = std::max(shelf_width, kAutoHideSize); | 886 shelf_width = std::max(shelf_width, kAutoHideSize); |
887 target_bounds->shelf_bounds_in_root.set_width(shelf_width); | 887 target_bounds->shelf_bounds_in_root.set_width(shelf_width); |
888 if (alignment_ == SHELF_ALIGNMENT_RIGHT) { | 888 if (alignment_ == SHELF_ALIGNMENT_RIGHT) { |
889 target_bounds->shelf_bounds_in_root.set_x( | 889 target_bounds->shelf_bounds_in_root.set_x( |
890 available_bounds.right() - shelf_width); | 890 available_bounds.right() - shelf_width); |
891 } | 891 } |
892 | 892 |
893 if (ash::switches::UseAlternateShelfLayout()) { | 893 if (ash::switches::UseAlternateShelfLayout()) { |
894 if (alignment_ == SHELF_ALIGNMENT_RIGHT) { | 894 if (alignment_ == SHELF_ALIGNMENT_RIGHT) { |
895 target_bounds->shelf_bounds_in_root.set_x( | 895 target_bounds->status_bounds_in_shelf.set_x(kStatusAreaInset); |
| 896 } else { |
| 897 target_bounds->status_bounds_in_shelf.set_x( |
896 available_bounds.right() - shelf_width + kStatusAreaInset); | 898 available_bounds.right() - shelf_width + kStatusAreaInset); |
897 } else { | |
898 target_bounds->shelf_bounds_in_root.set_x(kStatusAreaInset); | |
899 } | 899 } |
900 } else { | 900 } else { |
901 // The statusbar should be in the center of the shelf. | 901 // The statusbar should be in the center of the shelf. |
902 gfx::Rect status_x = target_bounds->shelf_bounds_in_root; | 902 gfx::Rect status_x = target_bounds->shelf_bounds_in_root; |
903 status_x.set_x(0); | 903 status_x.set_x(0); |
904 status_x.ClampToCenteredSize( | 904 status_x.ClampToCenteredSize( |
905 target_bounds->status_bounds_in_shelf.size()); | 905 target_bounds->status_bounds_in_shelf.size()); |
906 target_bounds->status_bounds_in_shelf.set_x(status_x.x()); | 906 target_bounds->status_bounds_in_shelf.set_x(status_x.x()); |
907 } | 907 } |
908 } | 908 } |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 return gfx::Insets(0, distance, 0, 0); | 1121 return gfx::Insets(0, distance, 0, 0); |
1122 case SHELF_ALIGNMENT_TOP: | 1122 case SHELF_ALIGNMENT_TOP: |
1123 return gfx::Insets(0, 0, distance, 0); | 1123 return gfx::Insets(0, 0, distance, 0); |
1124 } | 1124 } |
1125 NOTREACHED(); | 1125 NOTREACHED(); |
1126 return gfx::Insets(); | 1126 return gfx::Insets(); |
1127 } | 1127 } |
1128 | 1128 |
1129 } // namespace internal | 1129 } // namespace internal |
1130 } // namespace ash | 1130 } // namespace ash |
OLD | NEW |