OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "aura/root_window.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "aura/event.h" | |
9 #include "aura/window_delegate.h" | |
10 #include "ui/base/events.h" | |
11 | |
12 namespace aura { | |
13 namespace internal { | |
14 | |
15 RootWindow::RootWindow() : Window(NULL), mouse_pressed_handler_(NULL) { | |
16 } | |
17 | |
18 RootWindow::~RootWindow() { | |
19 } | |
20 | |
21 bool RootWindow::HandleMouseEvent(const MouseEvent& event) { | |
22 Window* target = mouse_pressed_handler_; | |
23 if (!target) | |
24 target = GetEventHandlerForPoint(event.location()); | |
25 if (event.type() == ui::ET_MOUSE_PRESSED && !mouse_pressed_handler_) | |
26 mouse_pressed_handler_ = target; | |
27 if (target->delegate()) { | |
28 MouseEvent translated_event(event, this, target); | |
29 return target->delegate()->OnMouseEvent(translated_event); | |
30 } | |
31 return false; | |
32 } | |
33 | |
34 } // namespace internal | |
35 } // namespace aura | |
OLD | NEW |