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/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 RootWindow* RootWindow::GetForAcceleratedWidget( | 139 RootWindow* RootWindow::GetForAcceleratedWidget( |
140 gfx::AcceleratedWidget widget) { | 140 gfx::AcceleratedWidget widget) { |
141 return reinterpret_cast<RootWindow*>( | 141 return reinterpret_cast<RootWindow*>( |
142 ui::ViewProp::GetValue(widget, kRootWindowForAcceleratedWidget)); | 142 ui::ViewProp::GetValue(widget, kRootWindowForAcceleratedWidget)); |
143 } | 143 } |
144 | 144 |
145 void RootWindow::Init() { | 145 void RootWindow::Init() { |
146 compositor()->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(this), | 146 compositor()->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(this), |
147 host_->GetBounds().size()); | 147 host_->GetBounds().size()); |
148 Window::Init(ui::LAYER_NOT_DRAWN); | 148 Window::Init(ui::LAYER_NOT_DRAWN); |
149 | |
150 gfx::Point point; | |
151 if (host_->QueryMouseLocation(&point)) | |
152 SetLastMouseLocation(this, ui::ConvertPointToDIP(layer(), point)); | |
153 | |
154 compositor()->SetRootLayer(layer()); | 149 compositor()->SetRootLayer(layer()); |
155 SetBounds( | 150 SetBounds( |
156 ui::ConvertRectToDIP(layer(), gfx::Rect(host_->GetBounds().size()))); | 151 ui::ConvertRectToDIP(layer(), gfx::Rect(host_->GetBounds().size()))); |
157 Show(); | 152 Show(); |
158 } | 153 } |
159 | 154 |
160 void RootWindow::ShowRootWindow() { | 155 void RootWindow::ShowRootWindow() { |
161 host_->Show(); | 156 host_->Show(); |
162 } | 157 } |
163 | 158 |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1040 ui::MouseEvent event(ui::ET_MOUSE_MOVED, | 1035 ui::MouseEvent event(ui::ET_MOUSE_MOVED, |
1041 orig_mouse_location, | 1036 orig_mouse_location, |
1042 orig_mouse_location, | 1037 orig_mouse_location, |
1043 ui::EF_IS_SYNTHESIZED); | 1038 ui::EF_IS_SYNTHESIZED); |
1044 event.set_system_location(Env::GetInstance()->last_mouse_location()); | 1039 event.set_system_location(Env::GetInstance()->last_mouse_location()); |
1045 OnHostMouseEvent(&event); | 1040 OnHostMouseEvent(&event); |
1046 #endif | 1041 #endif |
1047 } | 1042 } |
1048 | 1043 |
1049 } // namespace aura | 1044 } // namespace aura |
OLD | NEW |