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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 | 160 |
161 void RootWindow::SetHostBounds(const gfx::Rect& bounds) { | 161 void RootWindow::SetHostBounds(const gfx::Rect& bounds) { |
162 DispatchHeldMouseMove(); | 162 DispatchHeldMouseMove(); |
163 host_->SetBounds(bounds); | 163 host_->SetBounds(bounds); |
164 // Requery the location to constrain it within the new root window size. | 164 // Requery the location to constrain it within the new root window size. |
165 last_mouse_location_ = host_->QueryMouseLocation(); | 165 last_mouse_location_ = host_->QueryMouseLocation(); |
166 synthesize_mouse_move_ = false; | 166 synthesize_mouse_move_ = false; |
167 } | 167 } |
168 | 168 |
| 169 gfx::Point RootWindow::GetHostOrigin() const { |
| 170 return host_->GetBounds().origin(); |
| 171 } |
| 172 |
169 void RootWindow::SetCursor(gfx::NativeCursor cursor) { | 173 void RootWindow::SetCursor(gfx::NativeCursor cursor) { |
170 last_cursor_ = cursor; | 174 last_cursor_ = cursor; |
171 // A lot of code seems to depend on NULL cursors actually showing an arrow, | 175 // A lot of code seems to depend on NULL cursors actually showing an arrow, |
172 // so just pass everything along to the host. | 176 // so just pass everything along to the host. |
173 host_->SetCursor(cursor); | 177 host_->SetCursor(cursor); |
174 } | 178 } |
175 | 179 |
176 void RootWindow::ShowCursor(bool show) { | 180 void RootWindow::ShowCursor(bool show) { |
177 cursor_shown_ = show; | 181 cursor_shown_ = show; |
178 host_->ShowCursor(show); | 182 host_->ShowCursor(show); |
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 void RootWindow::UnlockCompositor() { | 965 void RootWindow::UnlockCompositor() { |
962 DCHECK(compositor_lock_); | 966 DCHECK(compositor_lock_); |
963 compositor_lock_ = NULL; | 967 compositor_lock_ = NULL; |
964 if (draw_on_compositor_unlock_) { | 968 if (draw_on_compositor_unlock_) { |
965 draw_on_compositor_unlock_ = false; | 969 draw_on_compositor_unlock_ = false; |
966 ScheduleDraw(); | 970 ScheduleDraw(); |
967 } | 971 } |
968 } | 972 } |
969 | 973 |
970 } // namespace aura | 974 } // namespace aura |
OLD | NEW |