diff options
author | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-26 02:10:35 +0000 |
---|---|---|
committer | zelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-26 02:10:35 +0000 |
commit | ca5e056c70fc697824da61bc7de94cfa92b87cc4 (patch) | |
tree | 3c58068f317550ae967ceabce4e195e11c36a1aa /ash | |
parent | a9e390c49aa040569fbfb76f6fb3e601658338df (diff) | |
download | chromium_src-ca5e056c70fc697824da61bc7de94cfa92b87cc4.zip chromium_src-ca5e056c70fc697824da61bc7de94cfa92b87cc4.tar.gz chromium_src-ca5e056c70fc697824da61bc7de94cfa92b87cc4.tar.bz2 |
Fixed screen capture confirmation dialog to be either system- or window-modal depending on where it got initiated from. Previous implementation created window-modal with no parent window which allowed it to hide underneath its browser window.
Fixed handling of window-modal dialogs. Modal dialogs and their toplevel parent windows weren't properly activated on events (i.e. mouse click) that happen in toplevel parent windows area but outside of the modal dialog.
TEST=added WindowModalityControllerTest.EventsForEclipsedWindows, manual: start go/present/<whatever>, try to alt-tab away from the pop up dialog, try to eclipse it with another browser window
BUG=366956
Review URL: https://codereview.chromium.org/252673002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266319 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/wm/window_modality_controller_unittest.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ash/wm/window_modality_controller_unittest.cc b/ash/wm/window_modality_controller_unittest.cc index 910b369..ce70432 100644 --- a/ash/wm/window_modality_controller_unittest.cc +++ b/ash/wm/window_modality_controller_unittest.cc @@ -206,6 +206,30 @@ TEST_F(WindowModalityControllerTest, Events) { } } +// Events on modal parent activate. +TEST_F(WindowModalityControllerTest, EventsForEclipsedWindows) { + aura::test::TestWindowDelegate d; + scoped_ptr<aura::Window> w1(CreateTestWindowInShellWithDelegate(&d, -1, + gfx::Rect(0, 0, 100, 100))); + scoped_ptr<aura::Window> w11(CreateTestWindowInShellWithDelegate(&d, -11, + gfx::Rect(20, 20, 50, 50))); + ::wm::AddTransientChild(w1.get(), w11.get()); + scoped_ptr<aura::Window> w2(CreateTestWindowInShellWithDelegate(&d, -2, + gfx::Rect(0, 0, 50, 50))); + + w11->SetProperty(aura::client::kModalKey, ui::MODAL_TYPE_WINDOW); + + // Partially eclipse w1 with w2. + wm::ActivateWindow(w2.get()); + { + // Clicking a point on w1 that is not eclipsed by w2. + aura::test::EventGenerator generator(Shell::GetPrimaryRootWindow(), + gfx::Point(90, 90)); + generator.ClickLeftButton(); + EXPECT_TRUE(wm::IsActiveWindow(w11.get())); + } +} + // Creates windows w1 and non activatiable child w11. Creates transient window // w2 and adds it as a transeint child of w1. Ensures that w2 is parented to // the parent of w1, and that GetModalTransient(w11) returns w2. |