| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ash/common/shelf/shelf.h" | |
| 6 | |
| 7 #include "ash/common/shelf/shelf_delegate.h" | |
| 8 #include "ash/common/shelf/wm_shelf.h" | |
| 9 #include "ash/common/wm_root_window_controller.h" | |
| 10 #include "ash/common/wm_shell.h" | |
| 11 #include "ash/common/wm_window.h" | |
| 12 | |
| 13 namespace ash { | |
| 14 | |
| 15 Shelf::Shelf(WmShelf* wm_shelf, | |
| 16 ShelfView* shelf_view, | |
| 17 ShelfWidget* shelf_widget) | |
| 18 : wm_shelf_(wm_shelf), | |
| 19 shelf_widget_(shelf_widget), | |
| 20 shelf_view_(shelf_view) { | |
| 21 DCHECK(wm_shelf_); | |
| 22 DCHECK(shelf_view_); | |
| 23 DCHECK(shelf_widget_); | |
| 24 } | |
| 25 | |
| 26 Shelf::~Shelf() { | |
| 27 WmShell::Get()->shelf_delegate()->OnShelfDestroyed(wm_shelf_); | |
| 28 } | |
| 29 | |
| 30 // static | |
| 31 Shelf* Shelf::ForPrimaryDisplay() { | |
| 32 return Shelf::ForWindow(WmShell::Get()->GetPrimaryRootWindow()); | |
| 33 } | |
| 34 | |
| 35 // static | |
| 36 Shelf* Shelf::ForWindow(WmWindow* window) { | |
| 37 return window->GetRootWindowController()->GetShelf()->shelf(); | |
| 38 } | |
| 39 | |
| 40 } // namespace ash | |
| OLD | NEW |