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

Side by Side Diff: ash/shell.cc

Issue 2393083005: Moves Shell::CreateShelf() to WmShell (Closed)
Patch Set: fix shell 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/shell.h ('k') | ash/shell/content/client/shell_browser_main_parts.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 return; 268 return;
269 } 269 }
270 } 270 }
271 271
272 void Shell::OnLoginStateChanged(LoginStatus status) { 272 void Shell::OnLoginStateChanged(LoginStatus status) {
273 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), 273 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(),
274 OnLoginStateChanged(status)); 274 OnLoginStateChanged(status));
275 } 275 }
276 276
277 void Shell::OnLoginUserProfilePrepared() { 277 void Shell::OnLoginUserProfilePrepared() {
278 CreateShelf(); 278 wm_shell_->CreateShelf();
279 CreateKeyboard(); 279 CreateKeyboard();
280 } 280 }
281 281
282 void Shell::UpdateAfterLoginStatusChange(LoginStatus status) { 282 void Shell::UpdateAfterLoginStatusChange(LoginStatus status) {
283 RootWindowControllerList controllers = GetAllRootWindowControllers(); 283 RootWindowControllerList controllers = GetAllRootWindowControllers();
284 for (RootWindowControllerList::iterator iter = controllers.begin(); 284 for (RootWindowControllerList::iterator iter = controllers.begin();
285 iter != controllers.end(); ++iter) 285 iter != controllers.end(); ++iter)
286 (*iter)->UpdateAfterLoginStatusChange(status); 286 (*iter)->UpdateAfterLoginStatusChange(status);
287 } 287 }
288 288
(...skipping 22 matching lines...) Expand all
311 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), 311 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(),
312 OnCastingSessionStartedOrStopped(started)); 312 OnCastingSessionStartedOrStopped(started));
313 #endif 313 #endif
314 } 314 }
315 315
316 void Shell::OnRootWindowAdded(WmWindow* root_window) { 316 void Shell::OnRootWindowAdded(WmWindow* root_window) {
317 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(), 317 FOR_EACH_OBSERVER(ShellObserver, *wm_shell_->shell_observers(),
318 OnRootWindowAdded(root_window)); 318 OnRootWindowAdded(root_window));
319 } 319 }
320 320
321 void Shell::CreateShelf() {
322 // Must occur after SessionStateDelegate creation and user login.
323 DCHECK(session_state_delegate_);
324 DCHECK_GT(session_state_delegate_->NumberOfLoggedInUsers(), 0);
325 wm_shell_->CreateShelfDelegate();
326
327 RootWindowControllerList controllers = GetAllRootWindowControllers();
328 for (RootWindowControllerList::iterator iter = controllers.begin();
329 iter != controllers.end(); ++iter)
330 (*iter)->CreateShelf();
331 }
332
333 void Shell::CreateKeyboard() { 321 void Shell::CreateKeyboard() {
334 // TODO(bshe): Primary root window controller may not be the controller to 322 // TODO(bshe): Primary root window controller may not be the controller to
335 // attach virtual keyboard. See http://crbug.com/303429 323 // attach virtual keyboard. See http://crbug.com/303429
336 InitKeyboard(); 324 InitKeyboard();
337 GetPrimaryRootWindowController()->ActivateKeyboard( 325 GetPrimaryRootWindowController()->ActivateKeyboard(
338 keyboard::KeyboardController::GetInstance()); 326 keyboard::KeyboardController::GetInstance());
339 } 327 }
340 328
341 void Shell::DeactivateKeyboard() { 329 void Shell::DeactivateKeyboard() {
342 // TODO(jamescook): Move keyboard create and hide into WmShell. 330 // TODO(jamescook): Move keyboard create and hide into WmShell.
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
916 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const { 904 std::unique_ptr<ui::EventTargetIterator> Shell::GetChildIterator() const {
917 return std::unique_ptr<ui::EventTargetIterator>(); 905 return std::unique_ptr<ui::EventTargetIterator>();
918 } 906 }
919 907
920 ui::EventTargeter* Shell::GetEventTargeter() { 908 ui::EventTargeter* Shell::GetEventTargeter() {
921 NOTREACHED(); 909 NOTREACHED();
922 return nullptr; 910 return nullptr;
923 } 911 }
924 912
925 } // namespace ash 913 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/shell/content/client/shell_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698