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_view.h" | 5 #include "ash/shelf/shelf_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/ash_constants.h" | 9 #include "ash/ash_constants.h" |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 1363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1374 | 1374 |
1375 // When an item is dragged off from the overflow bubble, it is moved to last | 1375 // When an item is dragged off from the overflow bubble, it is moved to last |
1376 // position and and changed to invisible. Overflow bubble size should be | 1376 // position and and changed to invisible. Overflow bubble size should be |
1377 // shrunk to fit only for visible items. | 1377 // shrunk to fit only for visible items. |
1378 if (is_overflow_mode() && dragged_off_shelf_ && | 1378 if (is_overflow_mode() && dragged_off_shelf_ && |
1379 RemovableByRipOff(view_model_->GetIndexOfView(drag_view_)) == REMOVABLE) | 1379 RemovableByRipOff(view_model_->GetIndexOfView(drag_view_)) == REMOVABLE) |
1380 last_button_index--; | 1380 last_button_index--; |
1381 | 1381 |
1382 const gfx::Rect last_button_bounds = | 1382 const gfx::Rect last_button_bounds = |
1383 last_button_index >= first_visible_index_ ? | 1383 last_button_index >= first_visible_index_ ? |
1384 view_model_->view_at(last_button_index)->bounds() : | 1384 view_model_->ideal_bounds(last_button_index) : |
1385 gfx::Rect(gfx::Size(preferred_size, preferred_size)); | 1385 gfx::Rect(gfx::Size(preferred_size, preferred_size)); |
1386 | 1386 |
1387 if (layout_manager_->IsHorizontalAlignment()) { | 1387 if (layout_manager_->IsHorizontalAlignment()) { |
1388 return gfx::Size(last_button_bounds.right() + leading_inset_, | 1388 return gfx::Size(last_button_bounds.right() + leading_inset_, |
1389 preferred_size); | 1389 preferred_size); |
1390 } | 1390 } |
1391 | 1391 |
1392 return gfx::Size(preferred_size, | 1392 return gfx::Size(preferred_size, |
1393 last_button_bounds.bottom() + leading_inset_); | 1393 last_button_bounds.bottom() + leading_inset_); |
1394 } | 1394 } |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1925 break; | 1925 break; |
1926 case ash::SHELF_ALIGNMENT_TOP: | 1926 case ash::SHELF_ALIGNMENT_TOP: |
1927 distance = coordinate.y() - bounds.bottom(); | 1927 distance = coordinate.y() - bounds.bottom(); |
1928 break; | 1928 break; |
1929 } | 1929 } |
1930 return distance > 0 ? distance : 0; | 1930 return distance > 0 ? distance : 0; |
1931 } | 1931 } |
1932 | 1932 |
1933 } // namespace internal | 1933 } // namespace internal |
1934 } // namespace ash | 1934 } // namespace ash |
OLD | NEW |