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

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

Issue 2046843005: mash: Migrate shelf menus to wm common types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ash_shell_with_content 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_view.cc ('k') | ash/shell/context_menu.h » ('j') | 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_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
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
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
OLDNEW
« no previous file with comments | « ash/shelf/shelf_view.cc ('k') | ash/shell/context_menu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698