diff options
author | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-25 22:15:52 +0000 |
---|---|---|
committer | sadrul@chromium.org <sadrul@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-25 22:15:52 +0000 |
commit | 7d018f7ff67d4f2febddaac5c98cfd76a79d58fd (patch) | |
tree | 628198b7d00bd4bc8bd5335dbed94756ea0558b8 /ash | |
parent | e69556705a762aa2562de604bd143679df8219cd (diff) | |
download | chromium_src-7d018f7ff67d4f2febddaac5c98cfd76a79d58fd.zip chromium_src-7d018f7ff67d4f2febddaac5c98cfd76a79d58fd.tar.gz chromium_src-7d018f7ff67d4f2febddaac5c98cfd76a79d58fd.tar.bz2 |
Revert 123669 because it broke builds:
---
When locking the screen via Ctrl-Shift-L from wrench menu,
login screen menus do not work, because wrench menu is not fully closed.
Made Noop events always make it to inner loop in the nested_dispatcher such that the menu can fully close itself via noop event.
Bug=113247
Testing=Manual
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=123500
Review URL: https://chromiumcodereview.appspot.com/9381008
TBR=pkotwicz@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9471001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@123670 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/accelerators/accelerator_dispatcher_linux.cc | 3 | ||||
-rw-r--r-- | ash/accelerators/accelerator_dispatcher_win.cc | 3 | ||||
-rw-r--r-- | ash/accelerators/nested_dispatcher_controller_unittest.cc | 126 | ||||
-rw-r--r-- | ash/ash.gyp | 2 |
4 files changed, 2 insertions, 132 deletions
diff --git a/ash/accelerators/accelerator_dispatcher_linux.cc b/ash/accelerators/accelerator_dispatcher_linux.cc index 8403480..4743e94 100644 --- a/ash/accelerators/accelerator_dispatcher_linux.cc +++ b/ash/accelerators/accelerator_dispatcher_linux.cc @@ -17,7 +17,6 @@ #include "ui/aura/event.h" #include "ui/aura/root_window.h" #include "ui/base/accelerators/accelerator.h" -#include "ui/base/events.h" namespace ash { @@ -32,7 +31,7 @@ base::MessagePumpDispatcher::DispatchStatus AcceleratorDispatcher::Dispatch( XEvent* xev) { if (!associated_window_) return EVENT_QUIT; - if (!ui::IsNoopEvent(xev) && !associated_window_->CanReceiveEvents()) + if (!associated_window_->CanReceiveEvents()) return aura::Env::GetInstance()->GetDispatcher()->Dispatch(xev); if (xev->type == KeyPress) { diff --git a/ash/accelerators/accelerator_dispatcher_win.cc b/ash/accelerators/accelerator_dispatcher_win.cc index 0383b3b..2aeceda 100644 --- a/ash/accelerators/accelerator_dispatcher_win.cc +++ b/ash/accelerators/accelerator_dispatcher_win.cc @@ -10,7 +10,6 @@ #include "ui/aura/event.h" #include "ui/aura/root_window.h" #include "ui/base/accelerators/accelerator.h" -#include "ui/base/events.h" namespace ash { @@ -24,7 +23,7 @@ const int kModifierMask = (ui::EF_SHIFT_DOWN | bool AcceleratorDispatcher::Dispatch(const MSG& msg) { if (!associated_window_) return false; - if (!ui::IsNoopEvent(msg) && !associated_window_->CanReceiveEvents()) + if (!associated_window_->CanReceiveEvents()) return aura::Env::GetInstance()->GetDispatcher()->Dispatch(msg); if(msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN) { diff --git a/ash/accelerators/nested_dispatcher_controller_unittest.cc b/ash/accelerators/nested_dispatcher_controller_unittest.cc deleted file mode 100644 index 47cac99..0000000 --- a/ash/accelerators/nested_dispatcher_controller_unittest.cc +++ /dev/null @@ -1,126 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/shell.h" -#include "ash/shell_window_ids.h" -#include "ash/test/ash_test_base.h" -#include "base/bind.h" -#include "base/event_types.h" -#include "base/message_loop.h" -#include "chrome/test/base/ui_test_utils.h" -#include "ui/aura/client/dispatcher_client.h" -#include "ui/aura/root_window.h" -#include "ui/aura/test/test_windows.h" -#include "ui/aura/window.h" - -#if defined(USE_X11) -#include <X11/Xlib.h> -#include "ui/base/x/x11_util.h" -#endif // USE_X11 - -namespace ash { -namespace test { - -namespace { - -class MockDispatcher : public MessageLoop::Dispatcher { - public: - MockDispatcher() : num_key_events_dispatched_(0) { - } - - int num_key_events_dispatched() { return num_key_events_dispatched_; } - -#if defined(OS_WIN) - virtual bool Dispatch(MSG msg) OVERRIDE { - if (msg.message == WM_KEYUP) - num_key_events_dispatched_++; - return !ui::IsNoopEvent(msg); - } -#elif defined(USE_X11) - virtual base::MessagePumpDispatcher::DispatchStatus Dispatch( - XEvent* xev) OVERRIDE { - if (xev->type == KeyRelease) - num_key_events_dispatched_++; - return ui::IsNoopEvent(xev) ? MessagePumpDispatcher::EVENT_QUIT : - MessagePumpDispatcher::EVENT_IGNORED; - } -#endif - - private: - int num_key_events_dispatched_; -}; - -void DispatchKeyEvent() { -#if defined(OS_WIN) - MSG native_event = { NULL, WM_KEYUP, ui::VKEY_A, 0 }; - ash::Shell::GetRootWindow()->PostNativeEvent(native_event); -#elif defined(USE_X11) - XEvent native_event; - ui::InitXKeyEventForTesting(ui::ET_KEY_RELEASED, - ui::VKEY_A, - 0, - &native_event); - ash::Shell::GetRootWindow()->PostNativeEvent(&native_event); -#endif - - // Send noop event to signal dispatcher to exit. - ash::Shell::GetRootWindow()->PostNativeEvent(ui::CreateNoopEvent()); -} - -} // namespace - -typedef AshTestBase NestedDispatcherTest; - -// Aura window below lock screen in z order. -TEST_F(NestedDispatcherTest, AssociatedWindowBelowLockScreen) { - MockDispatcher inner_dispatcher; - aura::Window* default_container = Shell::GetInstance()->GetContainer( - ash::internal::kShellWindowId_DefaultContainer); - scoped_ptr<aura::Window>associated_window(aura::test::CreateTestWindowWithId( - 0, default_container)); - scoped_ptr<aura::Window>mock_lock_container( - aura::test::CreateTestWindowWithId(0, default_container)); - mock_lock_container->set_stops_event_propagation(true); - aura::test::CreateTestWindowWithId(0, mock_lock_container.get()); - EXPECT_TRUE(aura::test::WindowIsAbove(mock_lock_container.get(), - associated_window.get())); - MessageLoop::current()->PostDelayedTask( - FROM_HERE, - base::Bind(&DispatchKeyEvent), - base::TimeDelta::FromMilliseconds(100)); - aura::client::GetDispatcherClient()->RunWithDispatcher( - &inner_dispatcher, - associated_window.get(), - true /* nestable_tasks_allowed */); - EXPECT_EQ(0, inner_dispatcher.num_key_events_dispatched()); -} - -// Aura window above lock screen in z order. -TEST_F(NestedDispatcherTest, AssociatedWindowAboveLockScreen) { - MockDispatcher inner_dispatcher; - - aura::Window* default_container = Shell::GetInstance()->GetContainer( - ash::internal::kShellWindowId_DefaultContainer); - scoped_ptr<aura::Window>mock_lock_container( - aura::test::CreateTestWindowWithId(0, default_container)); - mock_lock_container->set_stops_event_propagation(true); - aura::test::CreateTestWindowWithId(0, mock_lock_container.get()); - scoped_ptr<aura::Window>associated_window(aura::test::CreateTestWindowWithId( - 0, default_container)); - EXPECT_TRUE(aura::test::WindowIsAbove(associated_window.get(), - mock_lock_container.get())); - - MessageLoop::current()->PostDelayedTask( - FROM_HERE, - base::Bind(&DispatchKeyEvent), - base::TimeDelta::FromMilliseconds(100)); - aura::client::GetDispatcherClient()->RunWithDispatcher( - &inner_dispatcher, - associated_window.get(), - true /* nestable_tasks_allowed */); - EXPECT_EQ(1, inner_dispatcher.num_key_events_dispatched()); -} - -} // namespace test -} // namespace ash diff --git a/ash/ash.gyp b/ash/ash.gyp index a794547..ce530c7 100644 --- a/ash/ash.gyp +++ b/ash/ash.gyp @@ -246,7 +246,6 @@ '../ui/views/test/test_views_delegate.h', 'accelerators/accelerator_controller_unittest.cc', 'accelerators/accelerator_filter_unittest.cc', - 'accelerators/nested_dispatcher_controller_unittest.cc', 'drag_drop/drag_drop_controller_unittest.cc', 'ime/input_method_event_filter_unittest.cc', 'launcher/launcher_model_unittest.cc', @@ -299,7 +298,6 @@ 'sources/': [ ['exclude', 'accelerators/accelerator_controller_unittest.cc'], ['exclude', 'accelerators/accelerator_filter_unittest.cc'], - ['exclude', 'accelerators/nested_dispatcher_controller_unittest.cc'], ['exclude', 'drag_drop/drag_drop_controller_unittest.cc'], ['exclude', 'tooltips/tooltip_controller_unittest.cc'], ], |