| 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 |
| 149 compositor()->SetRootLayer(layer()); | 154 compositor()->SetRootLayer(layer()); |
| 150 SetBounds( | 155 SetBounds( |
| 151 ui::ConvertRectToDIP(layer(), gfx::Rect(host_->GetBounds().size()))); | 156 ui::ConvertRectToDIP(layer(), gfx::Rect(host_->GetBounds().size()))); |
| 152 Show(); | 157 Show(); |
| 153 } | 158 } |
| 154 | 159 |
| 155 void RootWindow::ShowRootWindow() { | 160 void RootWindow::ShowRootWindow() { |
| 156 host_->Show(); | 161 host_->Show(); |
| 157 } | 162 } |
| 158 | 163 |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1035 ui::MouseEvent event(ui::ET_MOUSE_MOVED, | 1040 ui::MouseEvent event(ui::ET_MOUSE_MOVED, |
| 1036 orig_mouse_location, | 1041 orig_mouse_location, |
| 1037 orig_mouse_location, | 1042 orig_mouse_location, |
| 1038 ui::EF_IS_SYNTHESIZED); | 1043 ui::EF_IS_SYNTHESIZED); |
| 1039 event.set_system_location(Env::GetInstance()->last_mouse_location()); | 1044 event.set_system_location(Env::GetInstance()->last_mouse_location()); |
| 1040 OnHostMouseEvent(&event); | 1045 OnHostMouseEvent(&event); |
| 1041 #endif | 1046 #endif |
| 1042 } | 1047 } |
| 1043 | 1048 |
| 1044 } // namespace aura | 1049 } // namespace aura |
| OLD | NEW |