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> |
11 | 11 |
12 #include "ash/screen_util.h" | 12 #include "ash/screen_util.h" |
13 #include "ash/shelf/shelf.h" | 13 #include "ash/shelf/shelf.h" |
14 #include "ash/shelf/shelf_layout_manager.h" | 14 #include "ash/shelf/shelf_layout_manager.h" |
15 #include "ash/shelf/shelf_widget.h" | 15 #include "ash/shelf/shelf_widget.h" |
16 #include "ash/shell.h" | 16 #include "ash/shell.h" |
oshima
2016/01/20 06:40:12
can we remove this?
scottmg
2016/01/26 20:46:35
Done.
| |
17 #include "ash/wm/window_util.h" | 17 #include "ash/wm/window_util.h" |
18 #include "ash/wm/workspace_controller.h" | 18 #include "ash/wm/workspace_controller.h" |
19 #include "base/command_line.h" | 19 #include "base/command_line.h" |
20 #include "base/compiler_specific.h" | 20 #include "base/compiler_specific.h" |
21 #include "base/logging.h" | 21 #include "base/logging.h" |
22 #include "base/message_loop/message_loop.h" | 22 #include "base/message_loop/message_loop.h" |
23 #include "base/stl_util.h" | 23 #include "base/stl_util.h" |
24 #include "base/time/time.h" | 24 #include "base/time/time.h" |
25 #include "ui/aura/client/aura_constants.h" | 25 #include "ui/aura/client/aura_constants.h" |
26 #include "ui/aura/window.h" | 26 #include "ui/aura/window.h" |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
486 break; | 486 break; |
487 } | 487 } |
488 return item_rect; | 488 return item_rect; |
489 } | 489 } |
490 } | 490 } |
491 | 491 |
492 // Coming here, there is no visible icon of that shelf item and we zoom back | 492 // Coming here, there is no visible icon of that shelf item and we zoom back |
493 // to the location of the application launcher (which is fixed as first item | 493 // to the location of the application launcher (which is fixed as first item |
494 // of the shelf). | 494 // of the shelf). |
495 gfx::Rect work_area = | 495 gfx::Rect work_area = |
496 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area(); | 496 gfx::Screen::GetScreen()->GetDisplayNearestWindow(window).work_area(); |
497 int ltr_adjusted_x = base::i18n::IsRTL() ? work_area.right() : work_area.x(); | 497 int ltr_adjusted_x = base::i18n::IsRTL() ? work_area.right() : work_area.x(); |
498 switch (layout_manager->GetAlignment()) { | 498 switch (layout_manager->GetAlignment()) { |
499 case SHELF_ALIGNMENT_BOTTOM: | 499 case SHELF_ALIGNMENT_BOTTOM: |
500 return gfx::Rect(ltr_adjusted_x, work_area.bottom(), 0, 0); | 500 return gfx::Rect(ltr_adjusted_x, work_area.bottom(), 0, 0); |
501 case SHELF_ALIGNMENT_TOP: | 501 case SHELF_ALIGNMENT_TOP: |
502 return gfx::Rect(ltr_adjusted_x, work_area.y(), 0, 0); | 502 return gfx::Rect(ltr_adjusted_x, work_area.y(), 0, 0); |
503 case SHELF_ALIGNMENT_LEFT: | 503 case SHELF_ALIGNMENT_LEFT: |
504 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); | 504 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); |
505 case SHELF_ALIGNMENT_RIGHT: | 505 case SHELF_ALIGNMENT_RIGHT: |
506 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); | 506 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); |
507 } | 507 } |
508 NOTREACHED(); | 508 NOTREACHED(); |
509 return gfx::Rect(); | 509 return gfx::Rect(); |
510 } | 510 } |
511 | 511 |
512 } // namespace ash | 512 } // namespace ash |
OLD | NEW |