OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shelf/shelf.h" | 5 #include "ash/shelf/shelf.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 | 9 |
10 #include "ash/focus_cycler.h" | 10 #include "ash/focus_cycler.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 alignment_ = alignment; | 72 alignment_ = alignment; |
73 shelf_view_->OnShelfAlignmentChanged(); | 73 shelf_view_->OnShelfAlignmentChanged(); |
74 // ShelfLayoutManager will resize the shelf. | 74 // ShelfLayoutManager will resize the shelf. |
75 } | 75 } |
76 | 76 |
77 bool Shelf::IsHorizontalAlignment() const { | 77 bool Shelf::IsHorizontalAlignment() const { |
78 return alignment_ == SHELF_ALIGNMENT_BOTTOM || | 78 return alignment_ == SHELF_ALIGNMENT_BOTTOM || |
79 alignment_ == SHELF_ALIGNMENT_TOP; | 79 alignment_ == SHELF_ALIGNMENT_TOP; |
80 } | 80 } |
81 | 81 |
| 82 void Shelf::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) { |
| 83 shelf_widget_->shelf_layout_manager()->SetAutoHideBehavior(behavior); |
| 84 } |
| 85 |
| 86 ShelfAutoHideBehavior Shelf::GetAutoHideBehavior() const { |
| 87 return shelf_widget_->shelf_layout_manager()->auto_hide_behavior(); |
| 88 } |
| 89 |
82 gfx::Rect Shelf::GetScreenBoundsOfItemIconForWindow( | 90 gfx::Rect Shelf::GetScreenBoundsOfItemIconForWindow( |
83 const aura::Window* window) { | 91 const aura::Window* window) { |
84 ShelfID id = GetShelfIDForWindow(window); | 92 ShelfID id = GetShelfIDForWindow(window); |
85 gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(id)); | 93 gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(id)); |
86 gfx::Point screen_origin; | 94 gfx::Point screen_origin; |
87 views::View::ConvertPointToScreen(shelf_view_, &screen_origin); | 95 views::View::ConvertPointToScreen(shelf_view_, &screen_origin); |
88 return gfx::Rect(screen_origin.x() + bounds.x(), | 96 return gfx::Rect(screen_origin.x() + bounds.x(), |
89 screen_origin.y() + bounds.y(), | 97 screen_origin.y() + bounds.y(), |
90 bounds.width(), | 98 bounds.width(), |
91 bounds.height()); | 99 bounds.height()); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 | 187 |
180 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { | 188 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { |
181 return shelf_view_->GetVisibleItemsBoundsInScreen(); | 189 return shelf_view_->GetVisibleItemsBoundsInScreen(); |
182 } | 190 } |
183 | 191 |
184 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { | 192 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { |
185 return shelf_view_; | 193 return shelf_view_; |
186 } | 194 } |
187 | 195 |
188 } // namespace ash | 196 } // namespace ash |
OLD | NEW |