| 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) | |
| 46 : wm_shelf_(wm_shelf), | 45 : wm_shelf_(wm_shelf), |
| 47 shelf_widget_(shelf_widget), | 46 shelf_widget_(shelf_widget), |
| 48 shelf_view_(new ShelfView(shelf_model, | 47 shelf_view_(new ShelfView(shelf_model, |
| 49 WmShell::Get()->shelf_delegate(), | 48 WmShell::Get()->shelf_delegate(), |
| 50 wm_shelf, | 49 wm_shelf, |
| 51 this, | 50 this)), |
| 52 background_animator)), | |
| 53 shelf_locking_manager_(wm_shelf) { | 51 shelf_locking_manager_(wm_shelf) { |
| 54 DCHECK(wm_shelf_); | 52 DCHECK(wm_shelf_); |
| 55 shelf_view_->Init(); | 53 shelf_view_->Init(); |
| 56 shelf_widget_->GetContentsView()->AddChildView(shelf_view_); | 54 shelf_widget_->GetContentsView()->AddChildView(shelf_view_); |
| 57 shelf_widget_->GetNativeView()->SetName(kNativeViewName); | 55 shelf_widget_->GetNativeView()->SetName(kNativeViewName); |
| 58 } | 56 } |
| 59 | 57 |
| 60 Shelf::~Shelf() { | 58 Shelf::~Shelf() { |
| 61 WmShell::Get()->shelf_delegate()->OnShelfDestroyed(this); | 59 WmShell::Get()->shelf_delegate()->OnShelfDestroyed(this); |
| 62 } | 60 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 210 |
| 213 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { | 211 gfx::Rect Shelf::GetVisibleItemsBoundsInScreen() const { |
| 214 return shelf_view_->GetVisibleItemsBoundsInScreen(); | 212 return shelf_view_->GetVisibleItemsBoundsInScreen(); |
| 215 } | 213 } |
| 216 | 214 |
| 217 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { | 215 app_list::ApplicationDragAndDropHost* Shelf::GetDragAndDropHostForAppList() { |
| 218 return shelf_view_; | 216 return shelf_view_; |
| 219 } | 217 } |
| 220 | 218 |
| 221 } // namespace ash | 219 } // namespace ash |
| OLD | NEW |