| 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::SetUseOSWindowBorders(bool use_os_borders) { |
| 239 host_->SetUseOSWindowBorders(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::DispatchWindowDragMovement(int hittest, MouseEvent* event) { |
| 381 return host_->DispatchWindowDragMovement(hittest, event); |
| 382 } |
| 383 |
| 376 void RootWindow::OnHostResized(const gfx::Size& size_in_pixel) { | 384 void RootWindow::OnHostResized(const gfx::Size& size_in_pixel) { |
| 377 DispatchHeldMouseMove(); | 385 DispatchHeldMouseMove(); |
| 378 // The compositor should have the same size as the native root window host. | 386 // 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. | 387 // Get the latest scale from monitor because it might have been changed. |
| 380 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromMonitor(this), | 388 compositor_->SetScaleAndSize(GetDeviceScaleFactorFromMonitor(this), |
| 381 size_in_pixel); | 389 size_in_pixel); |
| 382 gfx::Size old(bounds().size()); | 390 gfx::Size old(bounds().size()); |
| 383 // The layer, and all the observers should be notified of the | 391 // The layer, and all the observers should be notified of the |
| 384 // transformed size of the root window. | 392 // transformed size of the root window. |
| 385 gfx::Rect bounds(ui::ConvertSizeToDIP(layer(), size_in_pixel)); | 393 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() { | 1012 void RootWindow::UnlockCompositor() { |
| 1005 DCHECK(compositor_lock_); | 1013 DCHECK(compositor_lock_); |
| 1006 compositor_lock_ = NULL; | 1014 compositor_lock_ = NULL; |
| 1007 if (draw_on_compositor_unlock_) { | 1015 if (draw_on_compositor_unlock_) { |
| 1008 draw_on_compositor_unlock_ = false; | 1016 draw_on_compositor_unlock_ = false; |
| 1009 ScheduleDraw(); | 1017 ScheduleDraw(); |
| 1010 } | 1018 } |
| 1011 } | 1019 } |
| 1012 | 1020 |
| 1013 } // namespace aura | 1021 } // namespace aura |
| OLD | NEW |