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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // static | 65 // static |
66 Shelf* Shelf::ForWindow(const aura::Window* window) { | 66 Shelf* Shelf::ForWindow(const aura::Window* window) { |
67 ShelfWidget* shelf_widget = RootWindowController::ForWindow(window)->shelf(); | 67 ShelfWidget* shelf_widget = RootWindowController::ForWindow(window)->shelf(); |
68 return shelf_widget ? shelf_widget->shelf() : NULL; | 68 return shelf_widget ? shelf_widget->shelf() : NULL; |
69 } | 69 } |
70 | 70 |
71 void Shelf::SetAlignment(ShelfAlignment alignment) { | 71 void Shelf::SetAlignment(ShelfAlignment alignment) { |
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 delegate_->OnAlignmentChanged(alignment); |
75 } | 76 } |
76 | 77 |
77 bool Shelf::IsHorizontalAlignment() const { | 78 bool Shelf::IsHorizontalAlignment() const { |
78 return alignment_ == SHELF_ALIGNMENT_BOTTOM || | 79 return alignment_ == SHELF_ALIGNMENT_BOTTOM || |
79 alignment_ == SHELF_ALIGNMENT_TOP; | 80 alignment_ == SHELF_ALIGNMENT_TOP; |
80 } | 81 } |
81 | 82 |
82 void Shelf::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) { | 83 void Shelf::SetAutoHideBehavior(ShelfAutoHideBehavior behavior) { |
83 shelf_widget_->shelf_layout_manager()->SetAutoHideBehavior(behavior); | 84 shelf_widget_->shelf_layout_manager()->SetAutoHideBehavior(behavior); |
| 85 delegate_->OnAutoHideBehaviorChanged(behavior); |
84 } | 86 } |
85 | 87 |
86 ShelfAutoHideBehavior Shelf::GetAutoHideBehavior() const { | 88 ShelfAutoHideBehavior Shelf::GetAutoHideBehavior() const { |
87 return shelf_widget_->shelf_layout_manager()->auto_hide_behavior(); | 89 return shelf_widget_->shelf_layout_manager()->auto_hide_behavior(); |
88 } | 90 } |
89 | 91 |
90 gfx::Rect Shelf::GetScreenBoundsOfItemIconForWindow( | 92 gfx::Rect Shelf::GetScreenBoundsOfItemIconForWindow( |
91 const aura::Window* window) { | 93 const aura::Window* window) { |
92 ShelfID id = GetShelfIDForWindow(window); | 94 ShelfID id = GetShelfIDForWindow(window); |
93 gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(id)); | 95 gfx::Rect bounds(shelf_view_->GetIdealBoundsOfItemIcon(id)); |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 189 |
188 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { | 190 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { |
189 return shelf_view_->GetVisibleItemsBoundsInScreen(); | 191 return shelf_view_->GetVisibleItemsBoundsInScreen(); |
190 } | 192 } |
191 | 193 |
192 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { | 194 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { |
193 return shelf_view_; | 195 return shelf_view_; |
194 } | 196 } |
195 | 197 |
196 } // namespace ash | 198 } // namespace ash |
OLD | NEW |