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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 } | 189 } |
190 | 190 |
191 bool RootWindow::DispatchKeyEvent(KeyEvent* event) { | 191 bool RootWindow::DispatchKeyEvent(KeyEvent* event) { |
192 if (focused_window_) { | 192 if (focused_window_) { |
193 KeyEvent translated_event(*event); | 193 KeyEvent translated_event(*event); |
194 return ProcessKeyEvent(focused_window_, &translated_event); | 194 return ProcessKeyEvent(focused_window_, &translated_event); |
195 } | 195 } |
196 return false; | 196 return false; |
197 } | 197 } |
198 | 198 |
| 199 bool RootWindow::DispatchScrollEvent(ScrollEvent* event) { |
| 200 event->UpdateForTransform(layer()->transform()); |
| 201 |
| 202 last_mouse_location_ = event->location(); |
| 203 |
| 204 Window* target = |
| 205 mouse_pressed_handler_ ? mouse_pressed_handler_ : capture_window_; |
| 206 if (!target) |
| 207 target = GetEventHandlerForPoint(event->location()); |
| 208 |
| 209 if (target && target->delegate()) { |
| 210 int flags = event->flags(); |
| 211 gfx::Point location_in_window = event->location(); |
| 212 Window::ConvertPointToWindow(this, target, &location_in_window); |
| 213 if (IsNonClientLocation(target, location_in_window)) |
| 214 flags |= ui::EF_IS_NON_CLIENT; |
| 215 ScrollEvent translated_event(*event, this, target, event->type(), flags); |
| 216 return ProcessMouseEvent(target, &translated_event); |
| 217 } |
| 218 return false; |
| 219 } |
| 220 |
199 bool RootWindow::DispatchTouchEvent(TouchEvent* event) { | 221 bool RootWindow::DispatchTouchEvent(TouchEvent* event) { |
200 event->UpdateForTransform(layer()->transform()); | 222 event->UpdateForTransform(layer()->transform()); |
201 bool handled = false; | 223 bool handled = false; |
202 Window* target = | 224 Window* target = |
203 touch_event_handler_ ? touch_event_handler_ : capture_window_; | 225 touch_event_handler_ ? touch_event_handler_ : capture_window_; |
204 if (!target) | 226 if (!target) |
205 target = GetEventHandlerForPoint(event->location()); | 227 target = GetEventHandlerForPoint(event->location()); |
206 if (target) { | 228 if (target) { |
207 TouchEvent translated_event(*event, this, target); | 229 TouchEvent translated_event(*event, this, target); |
208 ui::TouchStatus status = ProcessTouchEvent(target, &translated_event); | 230 ui::TouchStatus status = ProcessTouchEvent(target, &translated_event); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { | 573 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { |
552 bounds.set_size(gfx::Size(parsed_width, parsed_height)); | 574 bounds.set_size(gfx::Size(parsed_width, parsed_height)); |
553 } else if (use_fullscreen_host_window_) { | 575 } else if (use_fullscreen_host_window_) { |
554 bounds = gfx::Rect(RootWindowHost::GetNativeScreenSize()); | 576 bounds = gfx::Rect(RootWindowHost::GetNativeScreenSize()); |
555 } | 577 } |
556 | 578 |
557 return bounds; | 579 return bounds; |
558 } | 580 } |
559 | 581 |
560 } // namespace aura | 582 } // namespace aura |
OLD | NEW |