| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ash/public/cpp/config.h" | 9 #include "ash/public/cpp/config.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 explicit TestWindow(bool modal) : modal_(modal) {} | 74 explicit TestWindow(bool modal) : modal_(modal) {} |
| 75 ~TestWindow() override {} | 75 ~TestWindow() override {} |
| 76 | 76 |
| 77 // The window needs be closed from widget in order for | 77 // The window needs be closed from widget in order for |
| 78 // aura::client::kModalKey property to be reset. | 78 // aura::client::kModalKey property to be reset. |
| 79 static void CloseTestWindow(aura::Window* window) { | 79 static void CloseTestWindow(aura::Window* window) { |
| 80 views::Widget::GetWidgetForNativeWindow(window)->Close(); | 80 views::Widget::GetWidgetForNativeWindow(window)->Close(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 // Overridden from views::View: | 83 // Overridden from views::View: |
| 84 gfx::Size GetPreferredSize() const override { return gfx::Size(50, 50); } | 84 gfx::Size CalculatePreferredSize() const override { |
| 85 return gfx::Size(50, 50); |
| 86 } |
| 85 | 87 |
| 86 // Overridden from views::WidgetDelegate: | 88 // Overridden from views::WidgetDelegate: |
| 87 ui::ModalType GetModalType() const override { | 89 ui::ModalType GetModalType() const override { |
| 88 return modal_ ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE; | 90 return modal_ ? ui::MODAL_TYPE_SYSTEM : ui::MODAL_TYPE_NONE; |
| 89 } | 91 } |
| 90 | 92 |
| 91 private: | 93 private: |
| 92 bool modal_; | 94 bool modal_; |
| 93 | 95 |
| 94 DISALLOW_COPY_AND_ASSIGN(TestWindow); | 96 DISALLOW_COPY_AND_ASSIGN(TestWindow); |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 921 | 923 |
| 922 // Make sure that events are properly blocked in multi displays environment. | 924 // Make sure that events are properly blocked in multi displays environment. |
| 923 TEST_F(SystemModalContainerLayoutManagerTest, BlockEventsInMultiDisplays) { | 925 TEST_F(SystemModalContainerLayoutManagerTest, BlockEventsInMultiDisplays) { |
| 924 UpdateDisplay("500x500, 500x500"); | 926 UpdateDisplay("500x500, 500x500"); |
| 925 InputTestDelegate delegate; | 927 InputTestDelegate delegate; |
| 926 delegate.RunTest(this); | 928 delegate.RunTest(this); |
| 927 } | 929 } |
| 928 | 930 |
| 929 } // namespace test | 931 } // namespace test |
| 930 } // namespace ash | 932 } // namespace ash |
| OLD | NEW |