| 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/root_window_controller.h" | 5 #include "ash/root_window_controller.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_constants.h" | 10 #include "ash/ash_constants.h" |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 return; | 511 return; |
| 512 } | 512 } |
| 513 | 513 |
| 514 Shell::GetInstance()->UpdateShelfVisibility(); | 514 Shell::GetInstance()->UpdateShelfVisibility(); |
| 515 } | 515 } |
| 516 | 516 |
| 517 void RootWindowController::UpdateShelfVisibility() { | 517 void RootWindowController::UpdateShelfVisibility() { |
| 518 shelf_->shelf_layout_manager()->UpdateVisibilityState(); | 518 shelf_->shelf_layout_manager()->UpdateVisibilityState(); |
| 519 } | 519 } |
| 520 | 520 |
| 521 const aura::Window* RootWindowController::GetTopmostFullscreenWindow() const { | 521 const aura::Window* RootWindowController::GetWindowForFullscreenMode() const { |
| 522 const aura::Window::Windows& windows = | 522 const aura::Window::Windows& windows = |
| 523 GetContainer(kShellWindowId_DefaultContainer)->children(); | 523 GetContainer(kShellWindowId_DefaultContainer)->children(); |
| 524 const aura::Window* topmost_window = NULL; |
| 524 for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin(); | 525 for (aura::Window::Windows::const_reverse_iterator iter = windows.rbegin(); |
| 525 iter != windows.rend(); ++iter) { | 526 iter != windows.rend(); ++iter) { |
| 526 if (wm::GetWindowState(*iter)->IsFullscreen()) | 527 if (((*iter)->type() == aura::client::WINDOW_TYPE_NORMAL || |
| 527 return *iter; | 528 (*iter)->type() == aura::client::WINDOW_TYPE_PANEL) && |
| 529 (*iter)->layer()->GetTargetVisibility()) { |
| 530 topmost_window = *iter; |
| 531 break; |
| 532 } |
| 533 } |
| 534 while (topmost_window) { |
| 535 if (wm::GetWindowState(topmost_window)->IsFullscreen()) |
| 536 return topmost_window; |
| 537 topmost_window = topmost_window->transient_parent(); |
| 528 } | 538 } |
| 529 return NULL; | 539 return NULL; |
| 530 } | 540 } |
| 531 | 541 |
| 532 aura::Window* RootWindowController::GetTopmostFullscreenWindow() { | 542 aura::Window* RootWindowController::GetWindowForFullscreenMode() { |
| 533 return const_cast<aura::Window*>( | 543 return const_cast<aura::Window*>( |
| 534 const_cast<const RootWindowController*>(this)-> | 544 const_cast<const RootWindowController*>(this)-> |
| 535 GetTopmostFullscreenWindow()); | 545 GetWindowForFullscreenMode()); |
| 536 } | 546 } |
| 537 | 547 |
| 538 void RootWindowController::ActivateKeyboard( | 548 void RootWindowController::ActivateKeyboard( |
| 539 keyboard::KeyboardController* keyboard_controller) { | 549 keyboard::KeyboardController* keyboard_controller) { |
| 540 if (!keyboard::IsKeyboardEnabled() || | 550 if (!keyboard::IsKeyboardEnabled() || |
| 541 GetContainer(kShellWindowId_VirtualKeyboardContainer)) { | 551 GetContainer(kShellWindowId_VirtualKeyboardContainer)) { |
| 542 return; | 552 return; |
| 543 } | 553 } |
| 544 DCHECK(keyboard_controller); | 554 DCHECK(keyboard_controller); |
| 545 if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { | 555 if (!keyboard::IsKeyboardUsabilityExperimentEnabled()) { |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 DisableTouchHudProjection(); | 939 DisableTouchHudProjection(); |
| 930 } | 940 } |
| 931 | 941 |
| 932 RootWindowController* GetRootWindowController( | 942 RootWindowController* GetRootWindowController( |
| 933 const aura::Window* root_window) { | 943 const aura::Window* root_window) { |
| 934 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; | 944 return root_window ? GetRootWindowSettings(root_window)->controller : NULL; |
| 935 } | 945 } |
| 936 | 946 |
| 937 } // namespace internal | 947 } // namespace internal |
| 938 } // namespace ash | 948 } // namespace ash |
| OLD | NEW |