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/window_animations.h" | 5 #include "ash/wm/window_animations.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 switch (shelf->alignment()) { | 472 switch (shelf->alignment()) { |
473 case SHELF_ALIGNMENT_BOTTOM: | 473 case SHELF_ALIGNMENT_BOTTOM: |
474 item_rect.set_y(shelf_bounds.y()); | 474 item_rect.set_y(shelf_bounds.y()); |
475 break; | 475 break; |
476 case SHELF_ALIGNMENT_LEFT: | 476 case SHELF_ALIGNMENT_LEFT: |
477 item_rect.set_x(shelf_bounds.right()); | 477 item_rect.set_x(shelf_bounds.right()); |
478 break; | 478 break; |
479 case SHELF_ALIGNMENT_RIGHT: | 479 case SHELF_ALIGNMENT_RIGHT: |
480 item_rect.set_x(shelf_bounds.x()); | 480 item_rect.set_x(shelf_bounds.x()); |
481 break; | 481 break; |
482 case SHELF_ALIGNMENT_TOP: | |
483 item_rect.set_y(shelf_bounds.bottom()); | |
484 break; | |
485 } | 482 } |
486 return item_rect; | 483 return item_rect; |
487 } | 484 } |
488 } | 485 } |
489 | 486 |
490 // Coming here, there is no visible icon of that shelf item and we zoom back | 487 // Coming here, there is no visible icon of that shelf item and we zoom back |
491 // to the location of the application launcher (which is fixed as first item | 488 // to the location of the application launcher (which is fixed as first item |
492 // of the shelf). | 489 // of the shelf). |
493 gfx::Rect work_area = | 490 gfx::Rect work_area = |
494 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area(); | 491 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area(); |
495 int ltr_adjusted_x = base::i18n::IsRTL() ? work_area.right() : work_area.x(); | 492 int ltr_adjusted_x = base::i18n::IsRTL() ? work_area.right() : work_area.x(); |
496 return shelf->SelectValueForShelfAlignment( | 493 return shelf->SelectValueForShelfAlignment( |
497 gfx::Rect(ltr_adjusted_x, work_area.bottom(), 0, 0), | 494 gfx::Rect(ltr_adjusted_x, work_area.bottom(), 0, 0), |
498 gfx::Rect(work_area.x(), work_area.y(), 0, 0), | 495 gfx::Rect(work_area.x(), work_area.y(), 0, 0), |
499 gfx::Rect(work_area.right(), work_area.y(), 0, 0), | 496 gfx::Rect(work_area.right(), work_area.y(), 0, 0)); |
500 gfx::Rect(ltr_adjusted_x, work_area.y(), 0, 0)); | |
501 } | 497 } |
502 | 498 |
503 } // namespace ash | 499 } // namespace ash |
OLD | NEW |