| 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/desktop.h" | 5 #include "ui/aura/desktop.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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 layer()->transform().TransformRect(&rect); | 113 layer()->transform().TransformRect(&rect); |
| 114 return rect.size(); | 114 return rect.size(); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void Desktop::SetCursor(gfx::NativeCursor cursor) { | 117 void Desktop::SetCursor(gfx::NativeCursor cursor) { |
| 118 host_->SetCursor(cursor); | 118 host_->SetCursor(cursor); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void Desktop::Run() { | 121 void Desktop::Run() { |
| 122 ShowDesktop(); | 122 ShowDesktop(); |
| 123 MessageLoopForUI::current()->Run(host_.get()); | 123 MessageLoopForUI::current()->RunWithDispatcher(host_.get()); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void Desktop::Draw() { | 126 void Desktop::Draw() { |
| 127 compositor_->Draw(false); | 127 compositor_->Draw(false); |
| 128 } | 128 } |
| 129 | 129 |
| 130 bool Desktop::DispatchMouseEvent(MouseEvent* event) { | 130 bool Desktop::DispatchMouseEvent(MouseEvent* event) { |
| 131 event->UpdateForTransform(layer()->transform()); | 131 event->UpdateForTransform(layer()->transform()); |
| 132 | 132 |
| 133 last_mouse_location_ = event->location(); | 133 last_mouse_location_ = event->location(); |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 !base::StringToInt(parts[0], &width) || | 427 !base::StringToInt(parts[0], &width) || |
| 428 !base::StringToInt(parts[1], &height) || | 428 !base::StringToInt(parts[1], &height) || |
| 429 width <= 0 || height <= 0) { | 429 width <= 0 || height <= 0) { |
| 430 width = kDefaultHostWindowWidth; | 430 width = kDefaultHostWindowWidth; |
| 431 height = kDefaultHostWindowHeight; | 431 height = kDefaultHostWindowHeight; |
| 432 } | 432 } |
| 433 return gfx::Rect(kDefaultHostWindowX, kDefaultHostWindowY, width, height); | 433 return gfx::Rect(kDefaultHostWindowX, kDefaultHostWindowY, width, height); |
| 434 } | 434 } |
| 435 | 435 |
| 436 } // namespace aura | 436 } // namespace aura |
| OLD | NEW |