| 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/aura/wm_window_aura.h" |
| 10 #include "ash/common/shelf/shelf_item_delegate.h" | 11 #include "ash/common/shelf/shelf_item_delegate.h" |
| 11 #include "ash/common/shelf/shelf_item_delegate_manager.h" | 12 #include "ash/common/shelf/shelf_item_delegate_manager.h" |
| 12 #include "ash/common/shelf/shelf_model.h" | 13 #include "ash/common/shelf/shelf_model.h" |
| 13 #include "ash/common/shelf/wm_shelf_util.h" | 14 #include "ash/common/shelf/wm_shelf_util.h" |
| 14 #include "ash/common/shell_window_ids.h" | 15 #include "ash/common/shell_window_ids.h" |
| 15 #include "ash/focus_cycler.h" | 16 #include "ash/focus_cycler.h" |
| 16 #include "ash/root_window_controller.h" | 17 #include "ash/root_window_controller.h" |
| 17 #include "ash/root_window_settings.h" | 18 #include "ash/root_window_settings.h" |
| 18 #include "ash/screen_util.h" | 19 #include "ash/screen_util.h" |
| 19 #include "ash/shelf/shelf_delegate.h" | 20 #include "ash/shelf/shelf_delegate.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) { | 89 alignment != SHELF_ALIGNMENT_BOTTOM_LOCKED) { |
| 89 shelf_locking_manager_.set_stored_alignment(alignment); | 90 shelf_locking_manager_.set_stored_alignment(alignment); |
| 90 return; | 91 return; |
| 91 } | 92 } |
| 92 | 93 |
| 93 alignment_ = alignment; | 94 alignment_ = alignment; |
| 94 shelf_view_->OnShelfAlignmentChanged(); | 95 shelf_view_->OnShelfAlignmentChanged(); |
| 95 shelf_widget_->OnShelfAlignmentChanged(); | 96 shelf_widget_->OnShelfAlignmentChanged(); |
| 96 delegate_->OnShelfAlignmentChanged(this); | 97 delegate_->OnShelfAlignmentChanged(this); |
| 97 Shell::GetInstance()->OnShelfAlignmentChanged( | 98 Shell::GetInstance()->OnShelfAlignmentChanged( |
| 98 shelf_widget_->GetNativeWindow()->GetRootWindow()); | 99 WmWindowAura::Get(shelf_widget_->GetNativeWindow()->GetRootWindow())); |
| 99 // ShelfLayoutManager will resize the shelf. | 100 // ShelfLayoutManager will resize the shelf. |
| 100 } | 101 } |
| 101 | 102 |
| 102 bool Shelf::IsHorizontalAlignment() const { | 103 bool Shelf::IsHorizontalAlignment() const { |
| 103 return ::ash::IsHorizontalAlignment(alignment_); | 104 return ::ash::IsHorizontalAlignment(alignment_); |
| 104 } | 105 } |
| 105 | 106 |
| 106 void Shelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) { | 107 void Shelf::SetAutoHideBehavior(ShelfAutoHideBehavior auto_hide_behavior) { |
| 107 if (auto_hide_behavior_ == auto_hide_behavior) | 108 if (auto_hide_behavior_ == auto_hide_behavior) |
| 108 return; | 109 return; |
| 109 | 110 |
| 110 auto_hide_behavior_ = auto_hide_behavior; | 111 auto_hide_behavior_ = auto_hide_behavior; |
| 111 delegate_->OnShelfAutoHideBehaviorChanged(this); | 112 delegate_->OnShelfAutoHideBehaviorChanged(this); |
| 112 Shell::GetInstance()->OnShelfAutoHideBehaviorChanged( | 113 Shell::GetInstance()->OnShelfAutoHideBehaviorChanged( |
| 113 shelf_widget_->GetNativeWindow()->GetRootWindow()); | 114 WmWindowAura::Get(shelf_widget_->GetNativeWindow()->GetRootWindow())); |
| 114 } | 115 } |
| 115 | 116 |
| 116 ShelfAutoHideState Shelf::GetAutoHideState() const { | 117 ShelfAutoHideState Shelf::GetAutoHideState() const { |
| 117 return shelf_widget_->shelf_layout_manager()->auto_hide_state(); | 118 return shelf_widget_->shelf_layout_manager()->auto_hide_state(); |
| 118 } | 119 } |
| 119 | 120 |
| 120 ShelfVisibilityState Shelf::GetVisibilityState() const { | 121 ShelfVisibilityState Shelf::GetVisibilityState() const { |
| 121 return shelf_widget_->shelf_layout_manager()->visibility_state(); | 122 return shelf_widget_->shelf_layout_manager()->visibility_state(); |
| 122 } | 123 } |
| 123 | 124 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 222 |
| 222 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { | 223 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { |
| 223 return shelf_view_->GetVisibleItemsBoundsInScreen(); | 224 return shelf_view_->GetVisibleItemsBoundsInScreen(); |
| 224 } | 225 } |
| 225 | 226 |
| 226 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { | 227 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { |
| 227 return shelf_view_; | 228 return shelf_view_; |
| 228 } | 229 } |
| 229 | 230 |
| 230 } // namespace ash | 231 } // namespace ash |
| OLD | NEW |