diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 20:59:52 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-01 20:59:52 +0000 |
commit | 4404c0783d68fca1bcea77a780789ca6a720d15f (patch) | |
tree | f607e45638748014391770f7936c96bb66cd024e /ash | |
parent | f522800ade9624102400dbe3b338213b67b8a1fe (diff) | |
download | chromium_src-4404c0783d68fca1bcea77a780789ca6a720d15f.zip chromium_src-4404c0783d68fca1bcea77a780789ca6a720d15f.tar.gz chromium_src-4404c0783d68fca1bcea77a780789ca6a720d15f.tar.bz2 |
Ensure that keyboard input works in Chrome AURA on Windows 8 in metro. cpu: please review everything,
sky: Please review the changes to ui and chrome\browser.
We need to send character events to the RenderViewHost class in addition to the KeyDown/Keyup events
for this to work.
To achieve this we register the character received event on the Windows 8 CoreWindow class and send the
character info via a new IPC message MetroViewerHostMsg_Character.
The chrome side handling for this message is performed in the MockInputMethod::DispatchFabricatedKeyEvent
function where we dispatch the message to the focused TextInputClient.
While working on this I also noticed that we were not sending the event flags like shift/alt/Ctrl, etc to
Chrome from the Metro code. Added support for that. This ensures that we are able to select text in the edit
fields on the page and the omnibox, etc.
The above changes will most likely not work with IME's. Will look into that in a subsequent change.
BUG=158637
R=cpu,sky
Review URL: https://codereview.chromium.org/11348053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165496 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/launcher/launcher_tooltip_manager_unittest.cc | 2 | ||||
-rw-r--r-- | ash/wm/user_activity_detector_unittest.cc | 4 | ||||
-rw-r--r-- | ash/wm/window_manager_unittest.cc | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/ash/launcher/launcher_tooltip_manager_unittest.cc b/ash/launcher/launcher_tooltip_manager_unittest.cc index 225d55f..1ae67ab 100644 --- a/ash/launcher/launcher_tooltip_manager_unittest.cc +++ b/ash/launcher/launcher_tooltip_manager_unittest.cc @@ -146,7 +146,7 @@ TEST_F(LauncherTooltipManagerTest, ShouldHideForEvents) { aura::EventFilter* event_filter = GetEventFilter(); // Should not hide for key events. - ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE); + ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false); EXPECT_FALSE(event_filter->PreHandleKeyEvent(root_window, &key_event)); EXPECT_TRUE(TooltipIsVisible()); diff --git a/ash/wm/user_activity_detector_unittest.cc b/ash/wm/user_activity_detector_unittest.cc index d614975..dcfde22 100644 --- a/ash/wm/user_activity_detector_unittest.cc +++ b/ash/wm/user_activity_detector_unittest.cc @@ -82,7 +82,7 @@ TEST_F(UserActivityDetectorTest, Basic) { scoped_ptr<aura::Window> window( aura::test::CreateTestWindowWithId(12345, NULL)); - ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE); + ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false); EXPECT_FALSE(detector_->PreHandleKeyEvent(window.get(), &key_event)); EXPECT_EQ(1, observer_->num_invocations()); observer_->reset_stats(); @@ -126,7 +126,7 @@ TEST_F(UserActivityDetectorTest, RateLimitNotifications) { aura::test::CreateTestWindowWithId(12345, NULL)); // The observer should be notified about a key event. - ui::KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE); + ui::KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_A, ui::EF_NONE, false); EXPECT_FALSE(detector_->PreHandleKeyEvent(window.get(), &event)); EXPECT_EQ(1, observer_->num_invocations()); observer_->reset_stats(); diff --git a/ash/wm/window_manager_unittest.cc b/ash/wm/window_manager_unittest.cc index f1d9b45..e0992dd 100644 --- a/ash/wm/window_manager_unittest.cc +++ b/ash/wm/window_manager_unittest.cc @@ -116,7 +116,7 @@ TEST_F(WindowManagerTest, Focus) { EXPECT_EQ(w121.get(), focus_manager->GetFocusedWindow()); // The key press should be sent to the focused sub-window. - ui::KeyEvent keyev(ui::ET_KEY_PRESSED, ui::VKEY_E, 0); + ui::KeyEvent keyev(ui::ET_KEY_PRESSED, ui::VKEY_E, 0, false); root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&keyev); EXPECT_EQ(ui::VKEY_E, w121delegate->last_key_code()); @@ -531,7 +531,7 @@ TEST_F(WindowManagerTest, AdditionalFilters) { env_filter->AddFilter(f2.get()); // Dispatches mouse and keyboard events. - ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, 0); + ui::KeyEvent key_event(ui::ET_KEY_PRESSED, ui::VKEY_A, 0, false); root_window->AsRootWindowHostDelegate()->OnHostKeyEvent(&key_event); ui::MouseEvent mouse_pressed( ui::ET_MOUSE_PRESSED, gfx::Point(0, 0), gfx::Point(0, 0), 0x0); |