| 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 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 #endif | 521 #endif |
| 522 | 522 |
| 523 void Shell::UpdateShelfVisibility() { | 523 void Shell::UpdateShelfVisibility() { |
| 524 RootWindowControllerList controllers = GetAllRootWindowControllers(); | 524 RootWindowControllerList controllers = GetAllRootWindowControllers(); |
| 525 for (RootWindowControllerList::iterator iter = controllers.begin(); | 525 for (RootWindowControllerList::iterator iter = controllers.begin(); |
| 526 iter != controllers.end(); ++iter) | 526 iter != controllers.end(); ++iter) |
| 527 if ((*iter)->shelf_widget()) | 527 if ((*iter)->shelf_widget()) |
| 528 (*iter)->UpdateShelfVisibility(); | 528 (*iter)->UpdateShelfVisibility(); |
| 529 } | 529 } |
| 530 | 530 |
| 531 void Shell::SetShelfAutoHideBehavior(ShelfAutoHideBehavior behavior, | |
| 532 aura::Window* root_window) { | |
| 533 Shelf::ForWindow(root_window)->SetAutoHideBehavior(behavior); | |
| 534 } | |
| 535 | |
| 536 ShelfAutoHideBehavior Shell::GetShelfAutoHideBehavior( | |
| 537 aura::Window* root_window) const { | |
| 538 return Shelf::ForWindow(root_window)->auto_hide_behavior(); | |
| 539 } | |
| 540 | |
| 541 void Shell::SetShelfAlignment(wm::ShelfAlignment alignment, | |
| 542 aura::Window* root_window) { | |
| 543 Shelf::ForWindow(root_window)->SetAlignment(alignment); | |
| 544 } | |
| 545 | |
| 546 wm::ShelfAlignment Shell::GetShelfAlignment( | |
| 547 const aura::Window* root_window) const { | |
| 548 return Shelf::ForWindow(root_window)->alignment(); | |
| 549 } | |
| 550 | |
| 551 void Shell::OnShelfAlignmentChanged(aura::Window* root_window) { | 531 void Shell::OnShelfAlignmentChanged(aura::Window* root_window) { |
| 552 FOR_EACH_OBSERVER(ShellObserver, observers_, | 532 FOR_EACH_OBSERVER(ShellObserver, observers_, |
| 553 OnShelfAlignmentChanged(root_window)); | 533 OnShelfAlignmentChanged(root_window)); |
| 554 } | 534 } |
| 555 | 535 |
| 556 void Shell::OnShelfAutoHideBehaviorChanged(aura::Window* root_window) { | 536 void Shell::OnShelfAutoHideBehaviorChanged(aura::Window* root_window) { |
| 557 FOR_EACH_OBSERVER(ShellObserver, observers_, | 537 FOR_EACH_OBSERVER(ShellObserver, observers_, |
| 558 OnShelfAutoHideBehaviorChanged(root_window)); | 538 OnShelfAutoHideBehaviorChanged(root_window)); |
| 559 } | 539 } |
| 560 | 540 |
| (...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1270 | 1250 |
| 1271 void Shell::OnWindowActivated( | 1251 void Shell::OnWindowActivated( |
| 1272 aura::client::ActivationChangeObserver::ActivationReason reason, | 1252 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 1273 aura::Window* gained_active, | 1253 aura::Window* gained_active, |
| 1274 aura::Window* lost_active) { | 1254 aura::Window* lost_active) { |
| 1275 if (gained_active) | 1255 if (gained_active) |
| 1276 target_root_window_ = gained_active->GetRootWindow(); | 1256 target_root_window_ = gained_active->GetRootWindow(); |
| 1277 } | 1257 } |
| 1278 | 1258 |
| 1279 } // namespace ash | 1259 } // namespace ash |
| OLD | NEW |