| 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/aura/wm_window_aura.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 #include "ui/views/widget/widget.h" | 34 #include "ui/views/widget/widget.h" |
| 35 #include "ui/views/widget/widget_delegate.h" | 35 #include "ui/views/widget/widget_delegate.h" |
| 36 #include "ui/wm/public/activation_client.h" | 36 #include "ui/wm/public/activation_client.h" |
| 37 | 37 |
| 38 namespace ash { | 38 namespace ash { |
| 39 | 39 |
| 40 const char Shelf::kNativeViewName[] = "ShelfView"; | 40 const char Shelf::kNativeViewName[] = "ShelfView"; |
| 41 | 41 |
| 42 Shelf::Shelf(ShelfModel* shelf_model, | 42 Shelf::Shelf(ShelfModel* shelf_model, |
| 43 WmShelf* wm_shelf, | 43 WmShelf* wm_shelf, |
| 44 ShelfWidget* shelf_widget) | 44 ShelfWidget* shelf_widget, |
| 45 ShelfBackgroundAnimator* background_animator) |
| 45 : wm_shelf_(wm_shelf), | 46 : wm_shelf_(wm_shelf), |
| 46 shelf_widget_(shelf_widget), | 47 shelf_widget_(shelf_widget), |
| 47 shelf_view_(new ShelfView(shelf_model, | 48 shelf_view_(new ShelfView(shelf_model, |
| 48 WmShell::Get()->shelf_delegate(), | 49 WmShell::Get()->shelf_delegate(), |
| 49 wm_shelf, | 50 wm_shelf, |
| 50 this)), | 51 this, |
| 52 background_animator)), |
| 51 shelf_locking_manager_(wm_shelf) { | 53 shelf_locking_manager_(wm_shelf) { |
| 52 DCHECK(wm_shelf_); | 54 DCHECK(wm_shelf_); |
| 53 shelf_view_->Init(); | 55 shelf_view_->Init(); |
| 54 shelf_widget_->GetContentsView()->AddChildView(shelf_view_); | 56 shelf_widget_->GetContentsView()->AddChildView(shelf_view_); |
| 55 shelf_widget_->GetNativeView()->SetName(kNativeViewName); | 57 shelf_widget_->GetNativeView()->SetName(kNativeViewName); |
| 56 } | 58 } |
| 57 | 59 |
| 58 Shelf::~Shelf() { | 60 Shelf::~Shelf() { |
| 59 WmShell::Get()->shelf_delegate()->OnShelfDestroyed(this); | 61 WmShell::Get()->shelf_delegate()->OnShelfDestroyed(this); |
| 60 } | 62 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 212 |
| 211 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { | 213 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { |
| 212 return shelf_view_->GetVisibleItemsBoundsInScreen(); | 214 return shelf_view_->GetVisibleItemsBoundsInScreen(); |
| 213 } | 215 } |
| 214 | 216 |
| 215 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { | 217 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { |
| 216 return shelf_view_; | 218 return shelf_view_; |
| 217 } | 219 } |
| 218 | 220 |
| 219 } // namespace ash | 221 } // namespace ash |
| OLD | NEW |