| 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/wm/system_modal_container_layout_manager.h" | 5 #include "ash/wm/system_modal_container_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 | 33 |
| 34 bool AllRootWindowsHaveModalBackgrounds() { | 34 bool AllRootWindowsHaveModalBackgrounds() { |
| 35 Shell::RootWindowControllerList controllers = | 35 Shell::RootWindowControllerList controllers = |
| 36 Shell::GetAllRootWindowControllers(); | 36 Shell::GetAllRootWindowControllers(); |
| 37 bool has_modal_screen = !controllers.empty(); | 37 bool has_modal_screen = !controllers.empty(); |
| 38 for (Shell::RootWindowControllerList::const_iterator iter = | 38 for (Shell::RootWindowControllerList::const_iterator iter = |
| 39 controllers.begin(); | 39 controllers.begin(); |
| 40 iter != controllers.end(); ++iter) { | 40 iter != controllers.end(); ++iter) { |
| 41 has_modal_screen &= | 41 has_modal_screen &= |
| 42 (*iter)->GetSystemModalLayoutManager()->has_modal_background(); | 42 (*iter)->GetSystemModalLayoutManager(NULL)->has_modal_background(); |
| 43 } | 43 } |
| 44 return has_modal_screen; | 44 return has_modal_screen; |
| 45 } | 45 } |
| 46 | 46 |
| 47 class TestWindow : public views::WidgetDelegateView { | 47 class TestWindow : public views::WidgetDelegateView { |
| 48 public: | 48 public: |
| 49 explicit TestWindow(bool modal) : modal_(modal) {} | 49 explicit TestWindow(bool modal) : modal_(modal) {} |
| 50 virtual ~TestWindow() {} | 50 virtual ~TestWindow() {} |
| 51 | 51 |
| 52 static aura::Window* OpenTestWindow(aura::Window* parent, bool modal) { | 52 static aura::Window* OpenTestWindow(aura::Window* parent, bool modal) { |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 EXPECT_TRUE(wm::IsActiveWindow(modal1.get())); | 404 EXPECT_TRUE(wm::IsActiveWindow(modal1.get())); |
| 405 | 405 |
| 406 // No more modal screen. | 406 // No more modal screen. |
| 407 modal1.reset(); | 407 modal1.reset(); |
| 408 EXPECT_FALSE(AllRootWindowsHaveModalBackgrounds()); | 408 EXPECT_FALSE(AllRootWindowsHaveModalBackgrounds()); |
| 409 EXPECT_TRUE(wm::IsActiveWindow(normal.get())); | 409 EXPECT_TRUE(wm::IsActiveWindow(normal.get())); |
| 410 } | 410 } |
| 411 | 411 |
| 412 } // namespace test | 412 } // namespace test |
| 413 } // namespace ash | 413 } // namespace ash |
| OLD | NEW |