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" |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 TRACE_EVENT_ASYNC_BEGIN0("ui", "RootWindow::Draw", draw_trace_count_++); | 228 TRACE_EVENT_ASYNC_BEGIN0("ui", "RootWindow::Draw", draw_trace_count_++); |
229 | 229 |
230 compositor_->Draw(false); | 230 compositor_->Draw(false); |
231 defer_draw_scheduling_ = false; | 231 defer_draw_scheduling_ = false; |
232 } | 232 } |
233 | 233 |
234 void RootWindow::ScheduleFullDraw() { | 234 void RootWindow::ScheduleFullDraw() { |
235 compositor_->ScheduleFullDraw(); | 235 compositor_->ScheduleFullDraw(); |
236 } | 236 } |
237 | 237 |
| 238 void RootWindow::SetUseHostWindowBorders(bool use_os_borders) { |
| 239 host_->SetUseHostWindowBorders(use_os_borders); |
| 240 } |
| 241 |
238 bool RootWindow::DispatchMouseEvent(MouseEvent* event) { | 242 bool RootWindow::DispatchMouseEvent(MouseEvent* event) { |
239 if (mouse_move_hold_count_) { | 243 if (mouse_move_hold_count_) { |
240 if (event->type() == ui::ET_MOUSE_DRAGGED || | 244 if (event->type() == ui::ET_MOUSE_DRAGGED || |
241 (event->flags() & ui::EF_IS_SYNTHESIZED)) { | 245 (event->flags() & ui::EF_IS_SYNTHESIZED)) { |
242 held_mouse_move_.reset(new MouseEvent(*event, NULL, NULL)); | 246 held_mouse_move_.reset(new MouseEvent(*event, NULL, NULL)); |
243 return true; | 247 return true; |
244 } else { | 248 } else { |
245 DispatchHeldMouseMove(); | 249 DispatchHeldMouseMove(); |
246 } | 250 } |
247 } | 251 } |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 370 |
367 if (target) { | 371 if (target) { |
368 GestureEvent translated_event(*event, this, target); | 372 GestureEvent translated_event(*event, this, target); |
369 ui::GestureStatus status = ProcessGestureEvent(target, &translated_event); | 373 ui::GestureStatus status = ProcessGestureEvent(target, &translated_event); |
370 return status != ui::GESTURE_STATUS_UNKNOWN; | 374 return status != ui::GESTURE_STATUS_UNKNOWN; |
371 } | 375 } |
372 | 376 |
373 return false; | 377 return false; |
374 } | 378 } |
375 | 379 |
| 380 bool RootWindow::DispatchHostWindowDragMovement(int hittest, |
| 381 MouseEvent* event) { |
| 382 return host_->DispatchHostWindowDragMovement(hittest, event); |
| 383 } |
| 384 |
376 void RootWindow::OnHostResized(const gfx::Size& size_in_pixel) { | 385 void RootWindow::OnHostResized(const gfx::Size& size_in_pixel) { |
377 DispatchHeldMouseMove(); | 386 DispatchHeldMouseMove(); |
378 // The compositor should have the same size as the native root window host. | 387 // The compositor should have the same size as the native root window host. |
379 // Get the latest scale from monitor because it might have been changed. | 388 // Get the latest scale from monitor because it might have been changed. |
380 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromMonitor(this), | 389 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromMonitor(this), |
381 size_in_pixel); | 390 size_in_pixel); |
382 gfx::Size old(bounds().size()); | 391 gfx::Size old(bounds().size()); |
383 // The layer, and all the observers should be notified of the | 392 // The layer, and all the observers should be notified of the |
384 // transformed size of the root window. | 393 // transformed size of the root window. |
385 gfx::Rect bounds(ui::ConvertSizeToDIP(layer(), size_in_pixel)); | 394 gfx::Rect bounds(ui::ConvertSizeToDIP(layer(), size_in_pixel)); |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 void RootWindow::UnlockCompositor() { | 1013 void RootWindow::UnlockCompositor() { |
1005 DCHECK(compositor_lock_); | 1014 DCHECK(compositor_lock_); |
1006 compositor_lock_ = NULL; | 1015 compositor_lock_ = NULL; |
1007 if (draw_on_compositor_unlock_) { | 1016 if (draw_on_compositor_unlock_) { |
1008 draw_on_compositor_unlock_ = false; | 1017 draw_on_compositor_unlock_ = false; |
1009 ScheduleDraw(); | 1018 ScheduleDraw(); |
1010 } | 1019 } |
1011 } | 1020 } |
1012 | 1021 |
1013 } // namespace aura | 1022 } // namespace aura |
OLD | NEW |