OLD | NEW |
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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 } | 431 } |
432 | 432 |
433 void Shell::OnMaximizeModeStarted() { | 433 void Shell::OnMaximizeModeStarted() { |
434 FOR_EACH_OBSERVER(ShellObserver, observers_, OnMaximizeModeStarted()); | 434 FOR_EACH_OBSERVER(ShellObserver, observers_, OnMaximizeModeStarted()); |
435 } | 435 } |
436 | 436 |
437 void Shell::OnMaximizeModeEnded() { | 437 void Shell::OnMaximizeModeEnded() { |
438 FOR_EACH_OBSERVER(ShellObserver, observers_, OnMaximizeModeEnded()); | 438 FOR_EACH_OBSERVER(ShellObserver, observers_, OnMaximizeModeEnded()); |
439 } | 439 } |
440 | 440 |
441 void Shell::OnRootWindowAdded(aura::Window* root_window) { | 441 void Shell::OnRootWindowAdded(WmWindow* root_window) { |
442 FOR_EACH_OBSERVER(ShellObserver, observers_, OnRootWindowAdded(root_window)); | 442 FOR_EACH_OBSERVER(ShellObserver, observers_, OnRootWindowAdded(root_window)); |
443 } | 443 } |
444 | 444 |
445 void Shell::CreateShelf() { | 445 void Shell::CreateShelf() { |
446 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 446 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
447 for (RootWindowControllerList::iterator iter = controllers.begin(); | 447 for (RootWindowControllerList::iterator iter = controllers.begin(); |
448 iter != controllers.end(); ++iter) | 448 iter != controllers.end(); ++iter) |
449 (*iter)->CreateShelf(); | 449 (*iter)->CreateShelf(); |
450 } | 450 } |
451 | 451 |
452 void Shell::OnShelfCreatedForRootWindow(aura::Window* root_window) { | 452 void Shell::OnShelfCreatedForRootWindow(WmWindow* root_window) { |
453 FOR_EACH_OBSERVER(ShellObserver, | 453 FOR_EACH_OBSERVER(ShellObserver, |
454 observers_, | 454 observers_, |
455 OnShelfCreatedForRootWindow(root_window)); | 455 OnShelfCreatedForRootWindow(root_window)); |
456 } | 456 } |
457 | 457 |
458 void Shell::CreateKeyboard() { | 458 void Shell::CreateKeyboard() { |
459 if (in_mus_) | 459 if (in_mus_) |
460 return; | 460 return; |
461 // TODO(bshe): Primary root window controller may not be the controller to | 461 // TODO(bshe): Primary root window controller may not be the controller to |
462 // attach virtual keyboard. See http://crbug.com/303429 | 462 // attach virtual keyboard. See http://crbug.com/303429 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 #endif | 520 #endif |
521 | 521 |
522 void Shell::UpdateShelfVisibility() { | 522 void Shell::UpdateShelfVisibility() { |
523 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 523 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
524 for (RootWindowControllerList::iterator iter = controllers.begin(); | 524 for (RootWindowControllerList::iterator iter = controllers.begin(); |
525 iter != controllers.end(); ++iter) | 525 iter != controllers.end(); ++iter) |
526 if ((*iter)->shelf_widget()) | 526 if ((*iter)->shelf_widget()) |
527 (*iter)->UpdateShelfVisibility(); | 527 (*iter)->UpdateShelfVisibility(); |
528 } | 528 } |
529 | 529 |
530 void Shell::OnShelfAlignmentChanged(aura::Window* root_window) { | 530 void Shell::OnShelfAlignmentChanged(WmWindow* root_window) { |
531 FOR_EACH_OBSERVER(ShellObserver, observers_, | 531 FOR_EACH_OBSERVER(ShellObserver, observers_, |
532 OnShelfAlignmentChanged(root_window)); | 532 OnShelfAlignmentChanged(root_window)); |
533 } | 533 } |
534 | 534 |
535 void Shell::OnShelfAutoHideBehaviorChanged(aura::Window* root_window) { | 535 void Shell::OnShelfAutoHideBehaviorChanged(WmWindow* root_window) { |
536 FOR_EACH_OBSERVER(ShellObserver, observers_, | 536 FOR_EACH_OBSERVER(ShellObserver, observers_, |
537 OnShelfAutoHideBehaviorChanged(root_window)); | 537 OnShelfAutoHideBehaviorChanged(root_window)); |
538 } | 538 } |
539 | 539 |
540 void Shell::NotifyFullscreenStateChange(bool is_fullscreen, | 540 void Shell::NotifyFullscreenStateChange(bool is_fullscreen, |
541 aura::Window* root_window) { | 541 WmWindow* root_window) { |
542 FOR_EACH_OBSERVER(ShellObserver, observers_, OnFullscreenStateChanged( | 542 FOR_EACH_OBSERVER(ShellObserver, observers_, OnFullscreenStateChanged( |
543 is_fullscreen, root_window)); | 543 is_fullscreen, root_window)); |
544 } | 544 } |
545 | 545 |
546 void Shell::CreateModalBackground(aura::Window* window) { | 546 void Shell::CreateModalBackground(aura::Window* window) { |
547 if (!modality_filter_) { | 547 if (!modality_filter_) { |
548 modality_filter_.reset(new SystemModalContainerEventFilter(this)); | 548 modality_filter_.reset(new SystemModalContainerEventFilter(this)); |
549 AddPreTargetHandler(modality_filter_.get()); | 549 AddPreTargetHandler(modality_filter_.get()); |
550 } | 550 } |
551 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 551 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 | 1249 |
1250 void Shell::OnWindowActivated( | 1250 void Shell::OnWindowActivated( |
1251 aura::client::ActivationChangeObserver::ActivationReason reason, | 1251 aura::client::ActivationChangeObserver::ActivationReason reason, |
1252 aura::Window* gained_active, | 1252 aura::Window* gained_active, |
1253 aura::Window* lost_active) { | 1253 aura::Window* lost_active) { |
1254 if (gained_active) | 1254 if (gained_active) |
1255 target_root_window_ = gained_active->GetRootWindow(); | 1255 target_root_window_ = gained_active->GetRootWindow(); |
1256 } | 1256 } |
1257 | 1257 |
1258 } // namespace ash | 1258 } // namespace ash |
OLD | NEW |