| 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) |
| 59 SelectValueForShelfAlignment( | 59 ->shelf_layout_manager() |
| 60 views::BubbleBorder::BOTTOM_CENTER, | 60 ->SelectValueForShelfAlignment( |
| 61 views::BubbleBorder::LEFT_CENTER, | 61 views::BubbleBorder::BOTTOM_CENTER, views::BubbleBorder::LEFT_CENTER, |
| 62 views::BubbleBorder::RIGHT_CENTER, | 62 views::BubbleBorder::RIGHT_CENTER, views::BubbleBorder::TOP_CENTER); |
| 63 views::BubbleBorder::TOP_CENTER); | |
| 64 } | 63 } |
| 65 | 64 |
| 66 // Offset given |rect| towards shelf. | 65 // Offset given |rect| towards shelf. |
| 67 gfx::Rect OffsetTowardsShelf(const gfx::Rect& rect, views::Widget* widget) { | 66 gfx::Rect OffsetTowardsShelf(const gfx::Rect& rect, views::Widget* widget) { |
| 68 DCHECK(Shell::HasInstance()); | 67 DCHECK(Shell::HasInstance()); |
| 69 ShelfAlignment shelf_alignment = Shell::GetInstance()->GetShelfAlignment( | 68 ShelfAlignment shelf_alignment = Shell::GetInstance()->GetShelfAlignment( |
| 70 widget->GetNativeView()->GetRootWindow()); | 69 widget->GetNativeView()->GetRootWindow()); |
| 71 gfx::Rect offseted(rect); | 70 gfx::Rect offseted(rect); |
| 72 switch (shelf_alignment) { | 71 switch (shelf_alignment) { |
| 73 case SHELF_ALIGNMENT_BOTTOM: | 72 case SHELF_ALIGNMENT_BOTTOM: |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 } else if (should_snap_back_) { | 555 } else if (should_snap_back_) { |
| 557 should_snap_back_ = false; | 556 should_snap_back_ = false; |
| 558 ui::ScopedLayerAnimationSettings animation(widget_animator); | 557 ui::ScopedLayerAnimationSettings animation(widget_animator); |
| 559 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( | 558 animation.SetTransitionDuration(base::TimeDelta::FromMilliseconds( |
| 560 app_list::kOverscrollPageTransitionDurationMs)); | 559 app_list::kOverscrollPageTransitionDurationMs)); |
| 561 widget->SetBounds(view_bounds_); | 560 widget->SetBounds(view_bounds_); |
| 562 } | 561 } |
| 563 } | 562 } |
| 564 | 563 |
| 565 } // namespace ash | 564 } // namespace ash |
| OLD | NEW |