| 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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/aura/wm_shelf_aura.h" | 8 #include "ash/aura/wm_shelf_aura.h" |
| 9 #include "ash/aura/wm_window_aura.h" | 9 #include "ash/aura/wm_window_aura.h" |
| 10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 | 713 |
| 714 bool ShelfWidget::GetDimsShelf() const { | 714 bool ShelfWidget::GetDimsShelf() const { |
| 715 return delegate_view_->GetDimmed(); | 715 return delegate_view_->GetDimmed(); |
| 716 } | 716 } |
| 717 | 717 |
| 718 void ShelfWidget::CreateShelf(WmShelfAura* wm_shelf_aura) { | 718 void ShelfWidget::CreateShelf(WmShelfAura* wm_shelf_aura) { |
| 719 DCHECK(!shelf_); | 719 DCHECK(!shelf_); |
| 720 | 720 |
| 721 Shell* shell = Shell::GetInstance(); | 721 Shell* shell = Shell::GetInstance(); |
| 722 ShelfDelegate* delegate = shell->GetShelfDelegate(); | 722 ShelfDelegate* delegate = shell->GetShelfDelegate(); |
| 723 shelf_.reset(new Shelf(shell->shelf_model(), delegate, this)); | 723 shelf_.reset(new Shelf(shell->shelf_model(), delegate, wm_shelf_aura, this)); |
| 724 // Must be initialized before the delegate is notified because the delegate | 724 // Must be initialized before the delegate is notified because the delegate |
| 725 // may try to access the WmShelf. | 725 // may try to access the WmShelf. |
| 726 wm_shelf_aura->SetShelf(shelf_.get()); | 726 wm_shelf_aura->SetShelf(shelf_.get()); |
| 727 delegate->OnShelfCreated(shelf_.get()); | 727 delegate->OnShelfCreated(shelf_.get()); |
| 728 | 728 |
| 729 SetFocusCycler(shell->focus_cycler()); | 729 SetFocusCycler(shell->focus_cycler()); |
| 730 } | 730 } |
| 731 | 731 |
| 732 void ShelfWidget::PostCreateShelf() { | 732 void ShelfWidget::PostCreateShelf() { |
| 733 shelf_->SetVisible(Shell::GetInstance() | 733 shelf_->SetVisible(Shell::GetInstance() |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event); | 813 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event); |
| 814 } | 814 } |
| 815 | 815 |
| 816 void ShelfWidget::OnGestureEvent(ui::GestureEvent* event) { | 816 void ShelfWidget::OnGestureEvent(ui::GestureEvent* event) { |
| 817 Widget::OnGestureEvent(event); | 817 Widget::OnGestureEvent(event); |
| 818 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_) | 818 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_) |
| 819 shelf_layout_manager_->UpdateAutoHideForGestureEvent(event); | 819 shelf_layout_manager_->UpdateAutoHideForGestureEvent(event); |
| 820 } | 820 } |
| 821 | 821 |
| 822 } // namespace ash | 822 } // namespace ash |
| OLD | NEW |