| 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/aura/wm_shelf_aura.h" | 7 #include "ash/aura/wm_shelf_aura.h" |
| 8 #include "ash/aura/wm_window_aura.h" | 8 #include "ash/aura/wm_window_aura.h" |
| 9 #include "ash/common/ash_switches.h" | 9 #include "ash/common/ash_switches.h" |
| 10 #include "ash/common/focus_cycler.h" | 10 #include "ash/common/focus_cycler.h" |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 status_area_widget_->SchedulePaint(); | 719 status_area_widget_->SchedulePaint(); |
| 720 } | 720 } |
| 721 | 721 |
| 722 bool ShelfWidget::GetDimsShelf() const { | 722 bool ShelfWidget::GetDimsShelf() const { |
| 723 return delegate_view_->GetDimmed(); | 723 return delegate_view_->GetDimmed(); |
| 724 } | 724 } |
| 725 | 725 |
| 726 void ShelfWidget::CreateShelf(WmShelfAura* wm_shelf_aura) { | 726 void ShelfWidget::CreateShelf(WmShelfAura* wm_shelf_aura) { |
| 727 DCHECK(!shelf_); | 727 DCHECK(!shelf_); |
| 728 | 728 |
| 729 Shell* shell = Shell::GetInstance(); | 729 ShelfDelegate* delegate = Shell::GetInstance()->GetShelfDelegate(); |
| 730 ShelfDelegate* delegate = shell->GetShelfDelegate(); | 730 shelf_.reset( |
| 731 shelf_.reset(new Shelf(shell->shelf_model(), delegate, wm_shelf_aura, this)); | 731 new Shelf(WmShell::Get()->shelf_model(), delegate, wm_shelf_aura, this)); |
| 732 // Must be initialized before the delegate is notified because the delegate | 732 // Must be initialized before the delegate is notified because the delegate |
| 733 // may try to access the WmShelf. | 733 // may try to access the WmShelf. |
| 734 wm_shelf_aura->SetShelf(shelf_.get()); | 734 wm_shelf_aura->SetShelf(shelf_.get()); |
| 735 delegate->OnShelfCreated(shelf_.get()); | 735 delegate->OnShelfCreated(shelf_.get()); |
| 736 | 736 |
| 737 SetFocusCycler(WmShell::Get()->focus_cycler()); | 737 SetFocusCycler(WmShell::Get()->focus_cycler()); |
| 738 } | 738 } |
| 739 | 739 |
| 740 void ShelfWidget::PostCreateShelf() { | 740 void ShelfWidget::PostCreateShelf() { |
| 741 shelf_->SetVisible( | 741 shelf_->SetVisible( |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 820 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event); | 820 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event); |
| 821 } | 821 } |
| 822 | 822 |
| 823 void ShelfWidget::OnGestureEvent(ui::GestureEvent* event) { | 823 void ShelfWidget::OnGestureEvent(ui::GestureEvent* event) { |
| 824 Widget::OnGestureEvent(event); | 824 Widget::OnGestureEvent(event); |
| 825 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_) | 825 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_) |
| 826 shelf_layout_manager_->UpdateAutoHideForGestureEvent(event); | 826 shelf_layout_manager_->UpdateAutoHideForGestureEvent(event); |
| 827 } | 827 } |
| 828 | 828 |
| 829 } // namespace ash | 829 } // namespace ash |
| OLD | NEW |