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

Side by Side Diff: ash/common/wm_shell.cc

Issue 2401803002: Moves Shell::ShowShelf() to WmShell (Closed)
Patch Set: Created 4 years, 2 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/common/wm_shell.h ('k') | ash/root_window_controller.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/common/wm_shell.h" 5 #include "ash/common/wm_shell.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/accelerators/accelerator_controller.h" 9 #include "ash/common/accelerators/accelerator_controller.h"
10 #include "ash/common/accelerators/ash_focus_manager_factory.h" 10 #include "ash/common/accelerators/ash_focus_manager_factory.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 if (GetSessionStateDelegate()->NumberOfLoggedInUsers() < 1 || 110 if (GetSessionStateDelegate()->NumberOfLoggedInUsers() < 1 ||
111 GetSessionStateDelegate()->IsScreenLocked()) { 111 GetSessionStateDelegate()->IsScreenLocked()) {
112 return; 112 return;
113 } 113 }
114 114
115 WmWindow* root = wm::GetRootWindowAt(location_in_screen); 115 WmWindow* root = wm::GetRootWindowAt(location_in_screen);
116 root->GetRootWindowController()->ShowContextMenu(location_in_screen, 116 root->GetRootWindowController()->ShowContextMenu(location_in_screen,
117 source_type); 117 source_type);
118 } 118 }
119 119
120 void WmShell::ShowShelf() {
121 for (WmWindow* root_window : GetAllRootWindows())
122 root_window->GetRootWindowController()->ShowShelf();
123 }
124
120 void WmShell::CreateShelfDelegate() { 125 void WmShell::CreateShelfDelegate() {
121 // May be called multiple times as shelves are created and destroyed. 126 // May be called multiple times as shelves are created and destroyed.
122 if (shelf_delegate_) 127 if (shelf_delegate_)
123 return; 128 return;
124 // Must occur after SessionStateDelegate creation and user login because 129 // Must occur after SessionStateDelegate creation and user login because
125 // Chrome's implementation of ShelfDelegate assumes it can get information 130 // Chrome's implementation of ShelfDelegate assumes it can get information
126 // about multi-profile login state. 131 // about multi-profile login state.
127 DCHECK(GetSessionStateDelegate()); 132 DCHECK(GetSessionStateDelegate());
128 DCHECK_GT(GetSessionStateDelegate()->NumberOfLoggedInUsers(), 0); 133 DCHECK_GT(GetSessionStateDelegate()->NumberOfLoggedInUsers(), 0);
129 shelf_delegate_.reset(delegate_->CreateShelfDelegate(shelf_model_.get())); 134 shelf_delegate_.reset(delegate_->CreateShelfDelegate(shelf_model_.get()));
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 void WmShell::DeleteToastManager() { 357 void WmShell::DeleteToastManager() {
353 toast_manager_.reset(); 358 toast_manager_.reset();
354 } 359 }
355 360
356 void WmShell::SetAcceleratorController( 361 void WmShell::SetAcceleratorController(
357 std::unique_ptr<AcceleratorController> accelerator_controller) { 362 std::unique_ptr<AcceleratorController> accelerator_controller) {
358 accelerator_controller_ = std::move(accelerator_controller); 363 accelerator_controller_ = std::move(accelerator_controller);
359 } 364 }
360 365
361 } // namespace ash 366 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wm_shell.h ('k') | ash/root_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698