Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: ash/shelf/shelf_widget.cc

Issue 2041583004: mash: Move WmShelfAura ownership to RootWindowController and init it earlier (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@moveshelftypes
Patch Set: . Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/shelf/shelf_widget.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_window_aura.h" 9 #include "ash/aura/wm_window_aura.h"
9 #include "ash/common/shelf/shelf_constants.h" 10 #include "ash/common/shelf/shelf_constants.h"
10 #include "ash/common/shelf/wm_shelf_util.h" 11 #include "ash/common/shelf/wm_shelf_util.h"
11 #include "ash/common/shell_window_ids.h" 12 #include "ash/common/shell_window_ids.h"
12 #include "ash/common/wm_root_window_controller.h" 13 #include "ash/common/wm_root_window_controller.h"
13 #include "ash/focus_cycler.h" 14 #include "ash/focus_cycler.h"
14 #include "ash/session/session_state_delegate.h" 15 #include "ash/session/session_state_delegate.h"
15 #include "ash/shelf/shelf_delegate.h" 16 #include "ash/shelf/shelf_delegate.h"
16 #include "ash/shelf/shelf_layout_manager.h" 17 #include "ash/shelf/shelf_layout_manager.h"
17 #include "ash/shelf/shelf_model.h" 18 #include "ash/shelf/shelf_model.h"
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 // status area background, app list button and overflow button. 709 // status area background, app list button and overflow button.
709 if (shelf_) 710 if (shelf_)
710 shelf_->SchedulePaint(); 711 shelf_->SchedulePaint();
711 status_area_widget_->SchedulePaint(); 712 status_area_widget_->SchedulePaint();
712 } 713 }
713 714
714 bool ShelfWidget::GetDimsShelf() const { 715 bool ShelfWidget::GetDimsShelf() const {
715 return delegate_view_->GetDimmed(); 716 return delegate_view_->GetDimmed();
716 } 717 }
717 718
718 void ShelfWidget::CreateShelf() { 719 void ShelfWidget::CreateShelf(WmShelfAura* wm_shelf_aura) {
719 DCHECK(!shelf_); 720 DCHECK(!shelf_);
720 721
721 Shell* shell = Shell::GetInstance(); 722 Shell* shell = Shell::GetInstance();
722 ShelfDelegate* delegate = shell->GetShelfDelegate(); 723 ShelfDelegate* delegate = shell->GetShelfDelegate();
723 shelf_.reset(new Shelf(shell->shelf_model(), delegate, this)); 724 shelf_.reset(new Shelf(shell->shelf_model(), delegate, this));
725 // Must be initialized before the delegate is notified because the delegate
726 // may try to access the WmShelf.
727 wm_shelf_aura->SetShelf(shelf_.get());
724 delegate->OnShelfCreated(shelf_.get()); 728 delegate->OnShelfCreated(shelf_.get());
725 729
726 SetFocusCycler(shell->focus_cycler()); 730 SetFocusCycler(shell->focus_cycler());
727 } 731 }
728 732
729 void ShelfWidget::PostCreateShelf() { 733 void ShelfWidget::PostCreateShelf() {
730 shelf_->SetVisible(Shell::GetInstance() 734 shelf_->SetVisible(Shell::GetInstance()
731 ->session_state_delegate() 735 ->session_state_delegate()
732 ->IsActiveUserSessionStarted()); 736 ->IsActiveUserSessionStarted());
733 shelf_layout_manager_->LayoutShelf(); 737 shelf_layout_manager_->LayoutShelf();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
810 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event); 814 shelf_layout_manager_->UpdateAutoHideForMouseEvent(event);
811 } 815 }
812 816
813 void ShelfWidget::OnGestureEvent(ui::GestureEvent* event) { 817 void ShelfWidget::OnGestureEvent(ui::GestureEvent* event) {
814 Widget::OnGestureEvent(event); 818 Widget::OnGestureEvent(event);
815 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_) 819 if (Shell::GetInstance()->in_mus() && shelf_layout_manager_)
816 shelf_layout_manager_->UpdateAutoHideForGestureEvent(event); 820 shelf_layout_manager_->UpdateAutoHideForGestureEvent(event);
817 } 821 }
818 822
819 } // namespace ash 823 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/shelf_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698