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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 | 516 |
517 ShelfAutoHideBehavior Shell::GetShelfAutoHideBehavior( | 517 ShelfAutoHideBehavior Shell::GetShelfAutoHideBehavior( |
518 aura::Window* root_window) const { | 518 aura::Window* root_window) const { |
519 ShelfWidget* shelf_widget = GetRootWindowController(root_window)->shelf(); | 519 ShelfWidget* shelf_widget = GetRootWindowController(root_window)->shelf(); |
520 return shelf_widget->shelf_layout_manager()->auto_hide_behavior(); | 520 return shelf_widget->shelf_layout_manager()->auto_hide_behavior(); |
521 } | 521 } |
522 | 522 |
523 void Shell::SetShelfAlignment(ShelfAlignment alignment, | 523 void Shell::SetShelfAlignment(ShelfAlignment alignment, |
524 aura::Window* root_window) { | 524 aura::Window* root_window) { |
525 ShelfWidget* shelf_widget = GetRootWindowController(root_window)->shelf(); | 525 ShelfWidget* shelf_widget = GetRootWindowController(root_window)->shelf(); |
526 if (shelf_widget->shelf_layout_manager()->SetAlignment(alignment)) { | 526 shelf_widget->shelf_layout_manager()->SetAlignment(alignment); |
527 FOR_EACH_OBSERVER( | |
528 ShellObserver, observers_, OnShelfAlignmentChanged(root_window)); | |
529 } | |
530 } | 527 } |
531 | 528 |
532 ShelfAlignment Shell::GetShelfAlignment(const aura::Window* root_window) { | 529 ShelfAlignment Shell::GetShelfAlignment(const aura::Window* root_window) const { |
533 ShelfWidget* shelf_widget = GetRootWindowController(root_window)->shelf(); | 530 ShelfWidget* shelf_widget = GetRootWindowController(root_window)->shelf(); |
534 return shelf_widget->shelf_layout_manager()->GetAlignment(); | 531 return shelf_widget->shelf_layout_manager()->GetAlignment(); |
535 } | 532 } |
536 | 533 |
| 534 void Shell::OnShelfAlignmentChanged(aura::Window* root_window) { |
| 535 FOR_EACH_OBSERVER(ShellObserver, observers_, |
| 536 OnShelfAlignmentChanged(root_window)); |
| 537 } |
| 538 |
537 void Shell::NotifyFullscreenStateChange(bool is_fullscreen, | 539 void Shell::NotifyFullscreenStateChange(bool is_fullscreen, |
538 aura::Window* root_window) { | 540 aura::Window* root_window) { |
539 FOR_EACH_OBSERVER(ShellObserver, observers_, OnFullscreenStateChanged( | 541 FOR_EACH_OBSERVER(ShellObserver, observers_, OnFullscreenStateChanged( |
540 is_fullscreen, root_window)); | 542 is_fullscreen, root_window)); |
541 } | 543 } |
542 | 544 |
543 void Shell::CreateModalBackground(aura::Window* window) { | 545 void Shell::CreateModalBackground(aura::Window* window) { |
544 if (!modality_filter_) { | 546 if (!modality_filter_) { |
545 modality_filter_.reset(new SystemModalContainerEventFilter(this)); | 547 modality_filter_.reset(new SystemModalContainerEventFilter(this)); |
546 AddPreTargetHandler(modality_filter_.get()); | 548 AddPreTargetHandler(modality_filter_.get()); |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1204 | 1206 |
1205 void Shell::OnWindowActivated( | 1207 void Shell::OnWindowActivated( |
1206 aura::client::ActivationChangeObserver::ActivationReason reason, | 1208 aura::client::ActivationChangeObserver::ActivationReason reason, |
1207 aura::Window* gained_active, | 1209 aura::Window* gained_active, |
1208 aura::Window* lost_active) { | 1210 aura::Window* lost_active) { |
1209 if (gained_active) | 1211 if (gained_active) |
1210 target_root_window_ = gained_active->GetRootWindow(); | 1212 target_root_window_ = gained_active->GetRootWindow(); |
1211 } | 1213 } |
1212 | 1214 |
1213 } // namespace ash | 1215 } // namespace ash |
OLD | NEW |