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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 Loading... |
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 |
OLD | NEW |