| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 // static | 63 // static |
| 64 Shelf* Shelf::ForWindow(const aura::Window* window) { | 64 Shelf* Shelf::ForWindow(const aura::Window* window) { |
| 65 ShelfWidget* shelf_widget = RootWindowController::ForWindow(window)->shelf(); | 65 ShelfWidget* shelf_widget = RootWindowController::ForWindow(window)->shelf(); |
| 66 return shelf_widget ? shelf_widget->shelf() : nullptr; | 66 return shelf_widget ? shelf_widget->shelf() : nullptr; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void Shelf::SetAlignment(ShelfAlignment alignment) { | 69 void Shelf::SetAlignment(ShelfAlignment alignment) { |
| 70 if (alignment_ == alignment) | 70 if (alignment_ == alignment) |
| 71 return; | 71 return; |
| 72 | 72 |
| 73 if (shelf_locking_manager_.is_locked() && |
| 74 alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) { |
| 75 shelf_locking_manager_.set_stored_alignment(alignment); |
| 76 return; |
| 77 } |
| 78 |
| 73 alignment_ = alignment; | 79 alignment_ = alignment; |
| 74 shelf_view_->OnShelfAlignmentChanged(); | 80 shelf_view_->OnShelfAlignmentChanged(); |
| 75 shelf_widget_->OnShelfAlignmentChanged(); | 81 shelf_widget_->OnShelfAlignmentChanged(); |
| 76 delegate_->OnShelfAlignmentChanged(this); | 82 delegate_->OnShelfAlignmentChanged(this); |
| 77 Shell::GetInstance()->OnShelfAlignmentChanged( | 83 Shell::GetInstance()->OnShelfAlignmentChanged( |
| 78 shelf_widget_->GetNativeWindow()->GetRootWindow()); | 84 shelf_widget_->GetNativeWindow()->GetRootWindow()); |
| 79 // ShelfLayoutManager will resize the shelf. | 85 // ShelfLayoutManager will resize the shelf. |
| 80 } | 86 } |
| 81 | 87 |
| 82 bool Shelf::IsHorizontalAlignment() const { | 88 bool Shelf::IsHorizontalAlignment() const { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 | 203 |
| 198 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { | 204 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { |
| 199 return shelf_view_->GetVisibleItemsBoundsInScreen(); | 205 return shelf_view_->GetVisibleItemsBoundsInScreen(); |
| 200 } | 206 } |
| 201 | 207 |
| 202 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { | 208 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { |
| 203 return shelf_view_; | 209 return shelf_view_; |
| 204 } | 210 } |
| 205 | 211 |
| 206 } // namespace ash | 212 } // namespace ash |
| OLD | NEW |