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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 return item_rect; | 475 return item_rect; |
476 } | 476 } |
477 } | 477 } |
478 | 478 |
479 // Coming here, there is no visible icon of that shelf item and we zoom back | 479 // Coming here, there is no visible icon of that shelf item and we zoom back |
480 // to the location of the application launcher (which is fixed as first item | 480 // to the location of the application launcher (which is fixed as first item |
481 // of the shelf). | 481 // of the shelf). |
482 gfx::Rect work_area = | 482 gfx::Rect work_area = |
483 display::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area(); | 483 display::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area(); |
484 int ltr_adjusted_x = base::i18n::IsRTL() ? work_area.right() : work_area.x(); | 484 int ltr_adjusted_x = base::i18n::IsRTL() ? work_area.right() : work_area.x(); |
485 return shelf->SelectValueForShelfAlignment( | 485 switch (shelf->alignment()) { |
486 gfx::Rect(ltr_adjusted_x, work_area.bottom(), 0, 0), | 486 case SHELF_ALIGNMENT_BOTTOM: |
487 gfx::Rect(work_area.x(), work_area.y(), 0, 0), | 487 case SHELF_ALIGNMENT_BOTTOM_LOCKED: |
488 gfx::Rect(work_area.right(), work_area.y(), 0, 0)); | 488 return gfx::Rect(ltr_adjusted_x, work_area.bottom(), 0, 0); |
| 489 case SHELF_ALIGNMENT_LEFT: |
| 490 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); |
| 491 case SHELF_ALIGNMENT_RIGHT: |
| 492 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); |
| 493 } |
| 494 NOTREACHED(); |
| 495 return gfx::Rect(); |
489 } | 496 } |
490 | 497 |
491 } // namespace ash | 498 } // namespace ash |
OLD | NEW |