| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "ui/aura/desktop.h" | 9 #include "ui/aura/desktop.h" |
| 10 #include "ui/aura/event.h" | 10 #include "ui/aura/event.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 MouseEvent translated_event(event, this, target); | 50 MouseEvent translated_event(event, this, target); |
| 51 return target->OnMouseEvent(&translated_event); | 51 return target->OnMouseEvent(&translated_event); |
| 52 } | 52 } |
| 53 return false; | 53 return false; |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool RootWindow::HandleKeyEvent(const KeyEvent& event) { | 56 bool RootWindow::HandleKeyEvent(const KeyEvent& event) { |
| 57 Window* focused_window = GetFocusManager()->focused_window(); | 57 Window* focused_window = GetFocusManager()->focused_window(); |
| 58 if (focused_window) { | 58 if (focused_window) { |
| 59 KeyEvent translated_event(event); | 59 KeyEvent translated_event(event); |
| 60 return GetFocusManager()->focused_window()->OnKeyEvent(&translated_event); | 60 return focused_window->OnKeyEvent(&translated_event); |
| 61 } | 61 } |
| 62 return false; | 62 return false; |
| 63 } | 63 } |
| 64 | 64 |
| 65 void RootWindow::SetCapture(Window* window) { | 65 void RootWindow::SetCapture(Window* window) { |
| 66 if (capture_window_ == window) | 66 if (capture_window_ == window) |
| 67 return; | 67 return; |
| 68 | 68 |
| 69 if (capture_window_ && capture_window_->delegate()) | 69 if (capture_window_ && capture_window_->delegate()) |
| 70 capture_window_->delegate()->OnCaptureLost(); | 70 capture_window_->delegate()->OnCaptureLost(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // Send an entered event. | 127 // Send an entered event. |
| 128 if (mouse_moved_handler_ && mouse_moved_handler_->delegate()) { | 128 if (mouse_moved_handler_ && mouse_moved_handler_->delegate()) { |
| 129 MouseEvent translated_event(event, this, mouse_moved_handler_, | 129 MouseEvent translated_event(event, this, mouse_moved_handler_, |
| 130 ui::ET_MOUSE_ENTERED); | 130 ui::ET_MOUSE_ENTERED); |
| 131 mouse_moved_handler_->OnMouseEvent(&translated_event); | 131 mouse_moved_handler_->OnMouseEvent(&translated_event); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 | 134 |
| 135 } // namespace internal | 135 } // namespace internal |
| 136 } // namespace aura | 136 } // namespace aura |
| OLD | NEW |