| Index: trunk/src/ui/aura/window_tree_host.cc
|
| ===================================================================
|
| --- trunk/src/ui/aura/window_tree_host.cc (revision 236091)
|
| +++ trunk/src/ui/aura/window_tree_host.cc (working copy)
|
| @@ -70,9 +70,9 @@
|
| };
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// WindowTreeHost, public:
|
| +// RootWindowHost, public:
|
|
|
| -WindowTreeHost::~WindowTreeHost() {
|
| +RootWindowHost::~RootWindowHost() {
|
| // TODO(beng): this represents an ordering change. In the old code, the
|
| // compositor was reset before the window hierarchy was destroyed.
|
| // verify that this has no adverse effects.
|
| @@ -81,7 +81,7 @@
|
| compositor_.reset();
|
| }
|
|
|
| -void WindowTreeHost::InitHost() {
|
| +void RootWindowHost::InitHost() {
|
| compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()),
|
| GetBounds().size());
|
| window()->Init(ui::LAYER_NOT_DRAWN);
|
| @@ -93,15 +93,15 @@
|
| window()->Show();
|
| }
|
|
|
| -aura::Window* WindowTreeHost::window() {
|
| - return const_cast<Window*>(const_cast<const WindowTreeHost*>(this)->window());
|
| +aura::Window* RootWindowHost::window() {
|
| + return const_cast<Window*>(const_cast<const RootWindowHost*>(this)->window());
|
| }
|
|
|
| -const aura::Window* WindowTreeHost::window() const {
|
| +const aura::Window* RootWindowHost::window() const {
|
| return delegate_->AsRootWindow()->window();
|
| }
|
|
|
| -void WindowTreeHost::SetRootWindowTransformer(
|
| +void RootWindowHost::SetRootWindowTransformer(
|
| scoped_ptr<RootWindowTransformer> transformer) {
|
| transformer_ = transformer.Pass();
|
| SetInsets(transformer_->GetHostInsets());
|
| @@ -112,7 +112,7 @@
|
| UpdateRootWindowSize(GetBounds().size());
|
| }
|
|
|
| -gfx::Transform WindowTreeHost::GetRootTransform() const {
|
| +gfx::Transform RootWindowHost::GetRootTransform() const {
|
| float scale = ui::GetDeviceScaleFactor(window()->layer());
|
| gfx::Transform transform;
|
| transform.Scale(scale, scale);
|
| @@ -120,61 +120,61 @@
|
| return transform;
|
| }
|
|
|
| -void WindowTreeHost::SetTransform(const gfx::Transform& transform) {
|
| +void RootWindowHost::SetTransform(const gfx::Transform& transform) {
|
| scoped_ptr<RootWindowTransformer> transformer(
|
| new SimpleRootWindowTransformer(window(), transform));
|
| SetRootWindowTransformer(transformer.Pass());
|
| }
|
|
|
| -gfx::Transform WindowTreeHost::GetInverseRootTransform() const {
|
| +gfx::Transform RootWindowHost::GetInverseRootTransform() const {
|
| float scale = ui::GetDeviceScaleFactor(window()->layer());
|
| gfx::Transform transform;
|
| transform.Scale(1.0f / scale, 1.0f / scale);
|
| return transformer_->GetInverseTransform() * transform;
|
| }
|
|
|
| -void WindowTreeHost::UpdateRootWindowSize(const gfx::Size& host_size) {
|
| +void RootWindowHost::UpdateRootWindowSize(const gfx::Size& host_size) {
|
| window()->SetBounds(transformer_->GetRootWindowBounds(host_size));
|
| }
|
|
|
| -void WindowTreeHost::ConvertPointToNativeScreen(gfx::Point* point) const {
|
| +void RootWindowHost::ConvertPointToNativeScreen(gfx::Point* point) const {
|
| ConvertPointToHost(point);
|
| gfx::Point location = GetLocationOnNativeScreen();
|
| point->Offset(location.x(), location.y());
|
| }
|
|
|
| -void WindowTreeHost::ConvertPointFromNativeScreen(gfx::Point* point) const {
|
| +void RootWindowHost::ConvertPointFromNativeScreen(gfx::Point* point) const {
|
| gfx::Point location = GetLocationOnNativeScreen();
|
| point->Offset(-location.x(), -location.y());
|
| ConvertPointFromHost(point);
|
| }
|
|
|
| -void WindowTreeHost::ConvertPointToHost(gfx::Point* point) const {
|
| +void RootWindowHost::ConvertPointToHost(gfx::Point* point) const {
|
| gfx::Point3F point_3f(*point);
|
| GetRootTransform().TransformPoint(&point_3f);
|
| *point = gfx::ToFlooredPoint(point_3f.AsPointF());
|
| }
|
|
|
| -void WindowTreeHost::ConvertPointFromHost(gfx::Point* point) const {
|
| +void RootWindowHost::ConvertPointFromHost(gfx::Point* point) const {
|
| gfx::Point3F point_3f(*point);
|
| GetInverseRootTransform().TransformPoint(&point_3f);
|
| *point = gfx::ToFlooredPoint(point_3f.AsPointF());
|
| }
|
|
|
| ////////////////////////////////////////////////////////////////////////////////
|
| -// WindowTreeHost, protected:
|
| +// RootWindowHost, protected:
|
|
|
| -WindowTreeHost::WindowTreeHost()
|
| +RootWindowHost::RootWindowHost()
|
| : delegate_(NULL) {
|
| }
|
|
|
| -void WindowTreeHost::CreateCompositor(
|
| +void RootWindowHost::CreateCompositor(
|
| gfx::AcceleratedWidget accelerated_widget) {
|
| compositor_.reset(new ui::Compositor(GetAcceleratedWidget()));
|
| DCHECK(compositor_.get());
|
| }
|
|
|
| -void WindowTreeHost::NotifyHostResized(const gfx::Size& new_size) {
|
| +void RootWindowHost::NotifyHostResized(const gfx::Size& new_size) {
|
| // The compositor should have the same size as the native root window host.
|
| // Get the latest scale from display because it might have been changed.
|
| compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(window()),
|
|
|