| 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/app_list_controller.h" | 5 #include "ash/wm/app_list_controller.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
| 9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
| 10 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // The minimal margin (in pixels) around the app list when in centered mode. | 48 // The minimal margin (in pixels) around the app list when in centered mode. |
| 49 const int kMinimalCenteredAppListMargin = 10; | 49 const int kMinimalCenteredAppListMargin = 10; |
| 50 | 50 |
| 51 ui::Layer* GetLayer(views::Widget* widget) { | 51 ui::Layer* GetLayer(views::Widget* widget) { |
| 52 return widget->GetNativeView()->layer(); | 52 return widget->GetNativeView()->layer(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 // Gets arrow location based on shelf alignment. | 55 // Gets arrow location based on shelf alignment. |
| 56 views::BubbleBorder::Arrow GetBubbleArrow(aura::Window* window) { | 56 views::BubbleBorder::Arrow GetBubbleArrow(aura::Window* window) { |
| 57 DCHECK(Shell::HasInstance()); | 57 DCHECK(Shell::HasInstance()); |
| 58 return ShelfLayoutManager::ForShelf(window)-> | 58 return Shelf::ForWindow(window)->SelectValueForShelfAlignment( |
| 59 SelectValueForShelfAlignment( | 59 views::BubbleBorder::BOTTOM_CENTER, views::BubbleBorder::LEFT_CENTER, |
| 60 views::BubbleBorder::BOTTOM_CENTER, | 60 views::BubbleBorder::RIGHT_CENTER, views::BubbleBorder::TOP_CENTER); |
| 61 views::BubbleBorder::LEFT_CENTER, | |
| 62 views::BubbleBorder::RIGHT_CENTER, | |
| 63 views::BubbleBorder::TOP_CENTER); | |
| 64 } | 61 } |
| 65 | 62 |
| 66 // Offset given |rect| towards shelf. | 63 // Offset given |rect| towards shelf. |
| 67 gfx::Rect OffsetTowardsShelf(const gfx::Rect& rect, views::Widget* widget) { | 64 gfx::Rect OffsetTowardsShelf(const gfx::Rect& rect, views::Widget* widget) { |
| 68 DCHECK(Shell::HasInstance()); | 65 DCHECK(Shell::HasInstance()); |
| 69 ShelfAlignment shelf_alignment = Shell::GetInstance()->GetShelfAlignment( | 66 ShelfAlignment shelf_alignment = Shell::GetInstance()->GetShelfAlignment( |
| 70 widget->GetNativeView()->GetRootWindow()); | 67 widget->GetNativeView()->GetRootWindow()); |
| 71 gfx::Rect offseted(rect); | 68 gfx::Rect offseted(rect); |
| 72 switch (shelf_alignment) { | 69 switch (shelf_alignment) { |
| 73 case SHELF_ALIGNMENT_BOTTOM: | 70 case SHELF_ALIGNMENT_BOTTOM: |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } else if (should_snap_back_) { | 553 } else if (should_snap_back_) { |
| 557 should_snap_back_ = false; | 554 should_snap_back_ = false; |
| 558 ui::ScopedLayerAnimationSettings animation(widget_animator); | 555 ui::ScopedLayerAnimationSettings animation(widget_animator); |
| 559 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 556 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
| 560 app_list::kOverscrollPageTransitionDurationMs)); | 557 app_list::kOverscrollPageTransitionDurationMs)); |
| 561 widget->SetBounds(view_bounds_); | 558 widget->SetBounds(view_bounds_); |
| 562 } | 559 } |
| 563 } | 560 } |
| 564 | 561 |
| 565 } // namespace ash | 562 } // namespace ash |
| OLD | NEW |