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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 window->ConvertEventToTarget(target, event); | 84 window->ConvertEventToTarget(target, event); |
85 return target; | 85 return target; |
86 } | 86 } |
87 } | 87 } |
88 return EventTargeter::FindTargetForLocatedEvent(root, event); | 88 return EventTargeter::FindTargetForLocatedEvent(root, event); |
89 } | 89 } |
90 | 90 |
91 Window* WindowTargeter::FindTargetForKeyEvent(Window* window, | 91 Window* WindowTargeter::FindTargetForKeyEvent(Window* window, |
92 const ui::KeyEvent& key) { | 92 const ui::KeyEvent& key) { |
93 Window* root_window = window->GetRootWindow(); | 93 Window* root_window = window->GetRootWindow(); |
94 if (key.key_code() == ui::VKEY_UNKNOWN) | 94 if (key.key_code() == ui::VKEY_UNKNOWN && |
| 95 (key.flags() & ui::EF_IME_FABRICATED_KEY) == 0) |
95 return NULL; | 96 return NULL; |
96 client::FocusClient* focus_client = client::GetFocusClient(root_window); | 97 client::FocusClient* focus_client = client::GetFocusClient(root_window); |
97 Window* focused_window = focus_client->GetFocusedWindow(); | 98 Window* focused_window = focus_client->GetFocusedWindow(); |
98 if (!focused_window) | 99 if (!focused_window) |
99 return window; | 100 return window; |
100 | 101 |
101 client::EventClient* event_client = client::GetEventClient(root_window); | 102 client::EventClient* event_client = client::GetEventClient(root_window); |
102 if (event_client && | 103 if (event_client && |
103 !event_client->CanProcessEventsWithinSubtree(focused_window)) { | 104 !event_client->CanProcessEventsWithinSubtree(focused_window)) { |
104 focus_client->FocusWindow(NULL); | 105 focus_client->FocusWindow(NULL); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 140 |
140 // If the initial touch is outside the root window, target the root. | 141 // If the initial touch is outside the root window, target the root. |
141 if (!root_window->bounds().Contains(event.location())) | 142 if (!root_window->bounds().Contains(event.location())) |
142 return root_window; | 143 return root_window; |
143 } | 144 } |
144 | 145 |
145 return NULL; | 146 return NULL; |
146 } | 147 } |
147 | 148 |
148 } // namespace aura | 149 } // namespace aura |
OLD | NEW |