Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/shell_surface.h" | |
|
msw
2017/03/09 21:57:20
nit: blank line after?
| |
| 5 #include "ash/common/accessibility_delegate.h" | 6 #include "ash/common/accessibility_delegate.h" |
| 6 #include "ash/common/wm/window_state.h" | 7 #include "ash/common/wm/window_state.h" |
| 7 #include "ash/common/wm/wm_event.h" | 8 #include "ash/common/wm/wm_event.h" |
| 8 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
| 9 #include "ash/common/wm_window.h" | 10 #include "ash/common/wm_window.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 11 #include "ash/public/cpp/shell_window_ids.h" |
| 12 #include "ash/shell.h" | |
| 11 #include "ash/wm/window_state_aura.h" | 13 #include "ash/wm/window_state_aura.h" |
| 12 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 14 #include "components/exo/buffer.h" | 16 #include "components/exo/buffer.h" |
| 15 #include "components/exo/display.h" | 17 #include "components/exo/display.h" |
| 16 #include "components/exo/shell_surface.h" | |
| 17 #include "components/exo/sub_surface.h" | 18 #include "components/exo/sub_surface.h" |
| 18 #include "components/exo/surface.h" | 19 #include "components/exo/surface.h" |
| 19 #include "components/exo/test/exo_test_base.h" | 20 #include "components/exo/test/exo_test_base.h" |
| 20 #include "components/exo/test/exo_test_helper.h" | 21 #include "components/exo/test/exo_test_helper.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 22 #include "ui/aura/client/aura_constants.h" | 23 #include "ui/aura/client/aura_constants.h" |
| 23 #include "ui/aura/window.h" | 24 #include "ui/aura/window.h" |
| 24 #include "ui/aura/window_targeter.h" | 25 #include "ui/aura/window_targeter.h" |
| 25 #include "ui/base/hit_test.h" | 26 #include "ui/base/hit_test.h" |
| 26 #include "ui/display/display.h" | 27 #include "ui/display/display.h" |
| (...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 894 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, | 895 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, |
| 895 ui::EF_LEFT_MOUSE_BUTTON); | 896 ui::EF_LEFT_MOUSE_BUTTON); |
| 896 gfx::Point pt_in(70, 70); | 897 gfx::Point pt_in(70, 70); |
| 897 ui::MouseEvent ev_in(ui::ET_MOUSE_PRESSED, pt_in, pt_in, | 898 ui::MouseEvent ev_in(ui::ET_MOUSE_PRESSED, pt_in, pt_in, |
| 898 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, | 899 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, |
| 899 ui::EF_LEFT_MOUSE_BUTTON); | 900 ui::EF_LEFT_MOUSE_BUTTON); |
| 900 | 901 |
| 901 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(shell_window, ev_out)); | 902 EXPECT_FALSE(targeter->SubtreeShouldBeExploredForEvent(shell_window, ev_out)); |
| 902 | 903 |
| 903 // Enable spoken feedback. | 904 // Enable spoken feedback. |
| 904 ash::WmShell::Get()->accessibility_delegate()->ToggleSpokenFeedback( | 905 ash::Shell::GetInstance()->accessibility_delegate()->ToggleSpokenFeedback( |
| 905 ash::A11Y_NOTIFICATION_NONE); | 906 ash::A11Y_NOTIFICATION_NONE); |
| 906 shell_surface.OnAccessibilityModeChanged(); | 907 shell_surface.OnAccessibilityModeChanged(); |
| 907 | 908 |
| 908 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(), | 909 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(), |
| 909 shell_surface.shadow_underlay()->bounds()); | 910 shell_surface.shadow_underlay()->bounds()); |
| 910 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); | 911 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); |
| 911 EXPECT_NE(shell_surface.GetWidget()->GetWindowBoundsInScreen(), | 912 EXPECT_NE(shell_surface.GetWidget()->GetWindowBoundsInScreen(), |
| 912 shell_surface.shadow_underlay()->bounds()); | 913 shell_surface.shadow_underlay()->bounds()); |
| 913 | 914 |
| 914 // Test event capture | 915 // Test event capture |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 931 surface2.Commit(); | 932 surface2.Commit(); |
| 932 | 933 |
| 933 // spoken-feedback was already on, so underlay should fill screen | 934 // spoken-feedback was already on, so underlay should fill screen |
| 934 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(), | 935 EXPECT_EQ(display::Screen::GetScreen()->GetPrimaryDisplay().bounds(), |
| 935 shell_surface2.shadow_underlay()->bounds()); | 936 shell_surface2.shadow_underlay()->bounds()); |
| 936 | 937 |
| 937 // De-activated shell-surface should NOT have fullscreen underlay | 938 // De-activated shell-surface should NOT have fullscreen underlay |
| 938 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); | 939 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); |
| 939 | 940 |
| 940 // Disable spoken feedback. Shadow underlay is restored. | 941 // Disable spoken feedback. Shadow underlay is restored. |
| 941 ash::WmShell::Get()->accessibility_delegate()->ToggleSpokenFeedback( | 942 ash::Shell::GetInstance()->accessibility_delegate()->ToggleSpokenFeedback( |
| 942 ash::A11Y_NOTIFICATION_NONE); | 943 ash::A11Y_NOTIFICATION_NONE); |
| 943 shell_surface.OnAccessibilityModeChanged(); | 944 shell_surface.OnAccessibilityModeChanged(); |
| 944 shell_surface2.OnAccessibilityModeChanged(); | 945 shell_surface2.OnAccessibilityModeChanged(); |
| 945 | 946 |
| 946 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); | 947 EXPECT_TRUE(shell_surface.shadow_underlay()->IsVisible()); |
| 947 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); | 948 EXPECT_EQ(shadow_bounds, shell_surface.shadow_underlay()->bounds()); |
| 948 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); | 949 EXPECT_EQ(shadow_bounds, shell_surface2.shadow_underlay()->bounds()); |
| 949 } | 950 } |
| 950 | 951 |
| 951 } // namespace | 952 } // namespace |
| 952 } // namespace exo | 953 } // namespace exo |
| OLD | NEW |