| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/root_window.h" | 5 #include "ui/aura/root_window.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "ui/aura/aura_switches.h" | 13 #include "ui/aura/aura_switches.h" |
| 14 #include "ui/aura/client/activation_client.h" | 14 #include "ui/aura/client/activation_client.h" |
| 15 #include "ui/aura/client/event_client.h" |
| 15 #include "ui/aura/env.h" | 16 #include "ui/aura/env.h" |
| 16 #include "ui/aura/root_window_host.h" | 17 #include "ui/aura/root_window_host.h" |
| 17 #include "ui/aura/root_window_observer.h" | 18 #include "ui/aura/root_window_observer.h" |
| 18 #include "ui/aura/event.h" | 19 #include "ui/aura/event.h" |
| 19 #include "ui/aura/event_filter.h" | 20 #include "ui/aura/event_filter.h" |
| 20 #include "ui/aura/focus_manager.h" | 21 #include "ui/aura/focus_manager.h" |
| 21 #include "ui/aura/gestures/gesture_recognizer.h" | 22 #include "ui/aura/gestures/gesture_recognizer.h" |
| 22 #include "ui/aura/monitor.h" | 23 #include "ui/aura/monitor.h" |
| 23 #include "ui/aura/monitor_manager.h" | 24 #include "ui/aura/monitor_manager.h" |
| 24 #include "ui/aura/window.h" | 25 #include "ui/aura/window.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 } else { | 202 } else { |
| 202 DispatchHeldMouseMove(); | 203 DispatchHeldMouseMove(); |
| 203 } | 204 } |
| 204 } | 205 } |
| 205 return DispatchMouseEventImpl(event); | 206 return DispatchMouseEventImpl(event); |
| 206 } | 207 } |
| 207 | 208 |
| 208 bool RootWindow::DispatchKeyEvent(KeyEvent* event) { | 209 bool RootWindow::DispatchKeyEvent(KeyEvent* event) { |
| 209 DispatchHeldMouseMove(); | 210 DispatchHeldMouseMove(); |
| 210 KeyEvent translated_event(*event); | 211 KeyEvent translated_event(*event); |
| 212 |
| 213 client::EventClient* client = client::GetEventClient(GetRootWindow()); |
| 214 if (client && !client->CanProcessEventsWithinSubtree(focused_window_)) { |
| 215 SetFocusedWindow(NULL, NULL); |
| 216 return false; |
| 217 } |
| 211 return ProcessKeyEvent(focused_window_, &translated_event); | 218 return ProcessKeyEvent(focused_window_, &translated_event); |
| 212 } | 219 } |
| 213 | 220 |
| 214 bool RootWindow::DispatchScrollEvent(ScrollEvent* event) { | 221 bool RootWindow::DispatchScrollEvent(ScrollEvent* event) { |
| 215 DispatchHeldMouseMove(); | 222 DispatchHeldMouseMove(); |
| 216 event->UpdateForRootTransform(layer()->transform()); | 223 event->UpdateForRootTransform(layer()->transform()); |
| 217 | 224 |
| 218 last_mouse_location_ = event->location(); | 225 last_mouse_location_ = event->location(); |
| 219 synthesize_mouse_move_ = false; | 226 synthesize_mouse_move_ = false; |
| 220 | 227 |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 // is currently broken. See/ crbug.com/107931. | 869 // is currently broken. See/ crbug.com/107931. |
| 863 MouseEvent event(ui::ET_MOUSE_MOVED, | 870 MouseEvent event(ui::ET_MOUSE_MOVED, |
| 864 orig_mouse_location, | 871 orig_mouse_location, |
| 865 orig_mouse_location, | 872 orig_mouse_location, |
| 866 ui::EF_IS_SYNTHESIZED); | 873 ui::EF_IS_SYNTHESIZED); |
| 867 DispatchMouseEvent(&event); | 874 DispatchMouseEvent(&event); |
| 868 #endif | 875 #endif |
| 869 } | 876 } |
| 870 | 877 |
| 871 } // namespace aura | 878 } // namespace aura |
| OLD | NEW |