OLD | NEW |
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 window->ConvertEventToTarget(target, event); | 97 window->ConvertEventToTarget(target, event); |
98 return target; | 98 return target; |
99 } | 99 } |
100 } | 100 } |
101 return EventTargeter::FindTargetForLocatedEvent(root, event); | 101 return EventTargeter::FindTargetForLocatedEvent(root, event); |
102 } | 102 } |
103 | 103 |
104 Window* WindowTargeter::FindTargetForKeyEvent(Window* window, | 104 Window* WindowTargeter::FindTargetForKeyEvent(Window* window, |
105 const ui::KeyEvent& key) { | 105 const ui::KeyEvent& key) { |
106 Window* root_window = window->GetRootWindow(); | 106 Window* root_window = window->GetRootWindow(); |
107 if (key.key_code() == ui::VKEY_UNKNOWN && | |
108 (key.flags() & ui::EF_IME_FABRICATED_KEY) == 0 && | |
109 key.GetCharacter() == 0) | |
110 return NULL; | |
111 client::FocusClient* focus_client = client::GetFocusClient(root_window); | 107 client::FocusClient* focus_client = client::GetFocusClient(root_window); |
112 Window* focused_window = focus_client->GetFocusedWindow(); | 108 Window* focused_window = focus_client->GetFocusedWindow(); |
113 if (!focused_window) | 109 if (!focused_window) |
114 return window; | 110 return window; |
115 | 111 |
116 client::EventClient* event_client = client::GetEventClient(root_window); | 112 client::EventClient* event_client = client::GetEventClient(root_window); |
117 if (event_client && | 113 if (event_client && |
118 !event_client->CanProcessEventsWithinSubtree(focused_window)) { | 114 !event_client->CanProcessEventsWithinSubtree(focused_window)) { |
119 focus_client->FocusWindow(NULL); | 115 focus_client->FocusWindow(NULL); |
120 return NULL; | 116 return NULL; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 150 |
155 // If the initial touch is outside the root window, target the root. | 151 // If the initial touch is outside the root window, target the root. |
156 if (!root_window->bounds().Contains(event.location())) | 152 if (!root_window->bounds().Contains(event.location())) |
157 return root_window; | 153 return root_window; |
158 } | 154 } |
159 | 155 |
160 return NULL; | 156 return NULL; |
161 } | 157 } |
162 | 158 |
163 } // namespace aura | 159 } // namespace aura |
OLD | NEW |