Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: ui/aura/window_targeter.cc

Issue 278843002: Don't kill key events even when it's VKEY_UNKNOWN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/window_event_dispatcher_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/aura/window_targeter.h" 5 #include "ui/aura/window_targeter.h"
6 6
7 #include "ui/aura/client/capture_client.h" 7 #include "ui/aura/client/capture_client.h"
8 #include "ui/aura/client/event_client.h" 8 #include "ui/aura/client/event_client.h"
9 #include "ui/aura/client/focus_client.h" 9 #include "ui/aura/client/focus_client.h"
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return target; 79 return target;
80 } 80 }
81 } 81 }
82 return EventTargeter::FindTargetForLocatedEvent(root, event); 82 return EventTargeter::FindTargetForLocatedEvent(root, event);
83 } 83 }
84 84
85 Window* WindowTargeter::FindTargetForKeyEvent(Window* window, 85 Window* WindowTargeter::FindTargetForKeyEvent(Window* window,
86 const ui::KeyEvent& key) { 86 const ui::KeyEvent& key) {
87 Window* root_window = window->GetRootWindow(); 87 Window* root_window = window->GetRootWindow();
88 if (key.key_code() == ui::VKEY_UNKNOWN && 88 if (key.key_code() == ui::VKEY_UNKNOWN &&
89 (key.flags() & ui::EF_IME_FABRICATED_KEY) == 0) 89 (key.flags() & ui::EF_IME_FABRICATED_KEY) == 0 &&
90 key.GetCharacter() == 0)
90 return NULL; 91 return NULL;
91 client::FocusClient* focus_client = client::GetFocusClient(root_window); 92 client::FocusClient* focus_client = client::GetFocusClient(root_window);
92 Window* focused_window = focus_client->GetFocusedWindow(); 93 Window* focused_window = focus_client->GetFocusedWindow();
93 if (!focused_window) 94 if (!focused_window)
94 return window; 95 return window;
95 96
96 client::EventClient* event_client = client::GetEventClient(root_window); 97 client::EventClient* event_client = client::GetEventClient(root_window);
97 if (event_client && 98 if (event_client &&
98 !event_client->CanProcessEventsWithinSubtree(focused_window)) { 99 !event_client->CanProcessEventsWithinSubtree(focused_window)) {
99 focus_client->FocusWindow(NULL); 100 focus_client->FocusWindow(NULL);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 135
135 // If the initial touch is outside the root window, target the root. 136 // If the initial touch is outside the root window, target the root.
136 if (!root_window->bounds().Contains(event.location())) 137 if (!root_window->bounds().Contains(event.location()))
137 return root_window; 138 return root_window;
138 } 139 }
139 140
140 return NULL; 141 return NULL;
141 } 142 }
142 143
143 } // namespace aura 144 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_event_dispatcher_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698