Chromium Code Reviews| 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/focus_cycler.h" | 8 #include "ash/focus_cycler.h" |
| 9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
| 10 #include "ash/session/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 744 void ShelfWidget::SetFocusCycler(FocusCycler* focus_cycler) { | 744 void ShelfWidget::SetFocusCycler(FocusCycler* focus_cycler) { |
| 745 delegate_view_->set_focus_cycler(focus_cycler); | 745 delegate_view_->set_focus_cycler(focus_cycler); |
| 746 if (focus_cycler) | 746 if (focus_cycler) |
| 747 focus_cycler->AddWidget(this); | 747 focus_cycler->AddWidget(this); |
| 748 } | 748 } |
| 749 | 749 |
| 750 FocusCycler* ShelfWidget::GetFocusCycler() { | 750 FocusCycler* ShelfWidget::GetFocusCycler() { |
| 751 return delegate_view_->focus_cycler(); | 751 return delegate_view_->focus_cycler(); |
| 752 } | 752 } |
| 753 | 753 |
| 754 void ShelfWidget::ShutdownStatusAreaWidget() { | 754 void ShelfWidget::Shutdown() { |
| 755 // Shutting down the status area widget may cause other widgets (e.g. bubbles) | |
| 756 // to close, so uninstall the ShelfLayoutManager event filters first. | |
| 757 if (shelf_layout_manager_) | |
| 758 shelf_layout_manager_->PrepareForShutdown(); | |
|
oshima
2016/05/24 20:49:10
can you also add comment why we shouldn't remove t
James Cook
2016/05/24 21:18:14
Good catch! Actually, if we reset the shelf_layout
| |
| 759 | |
| 755 if (status_area_widget_) { | 760 if (status_area_widget_) { |
| 756 Shell::GetInstance()->focus_cycler()->RemoveWidget(status_area_widget_); | 761 Shell::GetInstance()->focus_cycler()->RemoveWidget(status_area_widget_); |
| 757 status_area_widget_->Shutdown(); | 762 status_area_widget_->Shutdown(); |
| 763 status_area_widget_ = nullptr; | |
| 758 } | 764 } |
| 759 status_area_widget_ = NULL; | |
| 760 } | 765 } |
| 761 | 766 |
| 762 void ShelfWidget::ForceUndimming(bool force) { | 767 void ShelfWidget::ForceUndimming(bool force) { |
| 763 delegate_view_->ForceUndimming(force); | 768 delegate_view_->ForceUndimming(force); |
| 764 } | 769 } |
| 765 | 770 |
| 766 void ShelfWidget::OnWidgetActivationChanged(views::Widget* widget, | 771 void ShelfWidget::OnWidgetActivationChanged(views::Widget* widget, |
| 767 bool active) { | 772 bool active) { |
| 768 activating_as_fallback_ = false; | 773 activating_as_fallback_ = false; |
| 769 if (active) | 774 if (active) |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 788 DCHECK(delegate_view_); | 793 DCHECK(delegate_view_); |
| 789 return delegate_view_->disable_dimming_animations_for_test(); | 794 return delegate_view_->disable_dimming_animations_for_test(); |
| 790 } | 795 } |
| 791 | 796 |
| 792 void ShelfWidget::WillDeleteShelf() { | 797 void ShelfWidget::WillDeleteShelf() { |
| 793 shelf_layout_manager_->RemoveObserver(this); | 798 shelf_layout_manager_->RemoveObserver(this); |
| 794 shelf_layout_manager_ = NULL; | 799 shelf_layout_manager_ = NULL; |
| 795 } | 800 } |
| 796 | 801 |
| 797 } // namespace ash | 802 } // namespace ash |
| OLD | NEW |