| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/shelf/shelf_widget.h" | 5 #include "ash/shelf/shelf_widget.h" |
| 6 | 6 |
| 7 #include "ash/animation/animation_change_type.h" | 7 #include "ash/animation/animation_change_type.h" |
| 8 #include "ash/focus_cycler.h" | 8 #include "ash/focus_cycler.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/session/session_controller.h" | 10 #include "ash/session/session_controller.h" |
| 11 #include "ash/shelf/app_list_button.h" | 11 #include "ash/shelf/app_list_button.h" |
| 12 #include "ash/shelf/shelf_background_animator_observer.h" | 12 #include "ash/shelf/shelf_background_animator_observer.h" |
| 13 #include "ash/shelf/shelf_constants.h" | 13 #include "ash/shelf/shelf_constants.h" |
| 14 #include "ash/shelf/shelf_delegate.h" | |
| 15 #include "ash/shelf/shelf_layout_manager.h" | 14 #include "ash/shelf/shelf_layout_manager.h" |
| 16 #include "ash/shelf/shelf_view.h" | 15 #include "ash/shelf/shelf_view.h" |
| 17 #include "ash/shelf/wm_shelf.h" | 16 #include "ash/shelf/wm_shelf.h" |
| 18 #include "ash/shelf/wm_shelf_util.h" | 17 #include "ash/shelf/wm_shelf_util.h" |
| 19 #include "ash/shell.h" | 18 #include "ash/shell.h" |
| 20 #include "ash/system/status_area_layout_manager.h" | 19 #include "ash/system/status_area_layout_manager.h" |
| 21 #include "ash/system/status_area_widget.h" | 20 #include "ash/system/status_area_widget.h" |
| 22 #include "ash/wm/window_properties.h" | 21 #include "ash/wm/window_properties.h" |
| 23 #include "ash/wm_window.h" | 22 #include "ash/wm_window.h" |
| 24 #include "base/memory/ptr_util.h" | 23 #include "base/memory/ptr_util.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 221 |
| 223 void ShelfWidget::OnShelfAlignmentChanged() { | 222 void ShelfWidget::OnShelfAlignmentChanged() { |
| 224 shelf_view_->OnShelfAlignmentChanged(); | 223 shelf_view_->OnShelfAlignmentChanged(); |
| 225 // TODO(jamescook): Status area should not cache alignment. | 224 // TODO(jamescook): Status area should not cache alignment. |
| 226 status_area_widget_->SetShelfAlignment(wm_shelf_->GetAlignment()); | 225 status_area_widget_->SetShelfAlignment(wm_shelf_->GetAlignment()); |
| 227 delegate_view_->SchedulePaint(); | 226 delegate_view_->SchedulePaint(); |
| 228 } | 227 } |
| 229 | 228 |
| 230 ShelfView* ShelfWidget::CreateShelfView() { | 229 ShelfView* ShelfWidget::CreateShelfView() { |
| 231 DCHECK(!shelf_view_); | 230 DCHECK(!shelf_view_); |
| 232 | 231 shelf_view_ = new ShelfView(Shell::Get()->shelf_model(), wm_shelf_, this); |
| 233 shelf_view_ = new ShelfView(Shell::Get()->shelf_model(), | |
| 234 Shell::Get()->shelf_delegate(), wm_shelf_, this); | |
| 235 shelf_view_->Init(); | 232 shelf_view_->Init(); |
| 236 GetContentsView()->AddChildView(shelf_view_); | 233 GetContentsView()->AddChildView(shelf_view_); |
| 237 return shelf_view_; | 234 return shelf_view_; |
| 238 } | 235 } |
| 239 | 236 |
| 240 void ShelfWidget::PostCreateShelf() { | 237 void ShelfWidget::PostCreateShelf() { |
| 241 SetFocusCycler(Shell::Get()->focus_cycler()); | 238 SetFocusCycler(Shell::Get()->focus_cycler()); |
| 242 | 239 |
| 243 // Ensure the newly created |shelf_| gets current values. | 240 // Ensure the newly created |shelf_| gets current values. |
| 244 background_animator_.NotifyObserver(this); | 241 background_animator_.NotifyObserver(this); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 if (shelf_view_) | 348 if (shelf_view_) |
| 352 shelf_view_->UpdateShelfItemBackground(color); | 349 shelf_view_->UpdateShelfItemBackground(color); |
| 353 } | 350 } |
| 354 | 351 |
| 355 void ShelfWidget::WillDeleteShelfLayoutManager() { | 352 void ShelfWidget::WillDeleteShelfLayoutManager() { |
| 356 shelf_layout_manager_->RemoveObserver(this); | 353 shelf_layout_manager_->RemoveObserver(this); |
| 357 shelf_layout_manager_ = nullptr; | 354 shelf_layout_manager_ = nullptr; |
| 358 } | 355 } |
| 359 | 356 |
| 360 } // namespace ash | 357 } // namespace ash |
| OLD | NEW |