Home | History | Annotate | Download | only in aura
      1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #include "ui/aura/window_tree_host.h"
      6 
      7 #include "ui/aura/root_window.h"
      8 #include "ui/aura/window_tree_host_delegate.h"
      9 #include "ui/gfx/point.h"
     10 
     11 namespace aura {
     12 
     13 ////////////////////////////////////////////////////////////////////////////////
     14 // RootWindowHost, public:
     15 
     16 RootWindowHost::~RootWindowHost() {
     17 }
     18 
     19 void RootWindowHost::ConvertPointToNativeScreen(gfx::Point* point) const {
     20   delegate_->AsRootWindow()->ConvertPointToHost(point);
     21   gfx::Point location = GetLocationOnNativeScreen();
     22   point->Offset(location.x(), location.y());
     23 }
     24 
     25 void RootWindowHost::ConvertPointFromNativeScreen(gfx::Point* point) const {
     26   gfx::Point location = GetLocationOnNativeScreen();
     27   point->Offset(-location.x(), -location.y());
     28   delegate_->AsRootWindow()->ConvertPointFromHost(point);
     29 }
     30 
     31 ////////////////////////////////////////////////////////////////////////////////
     32 // RootWindowHost, protected:
     33 
     34 RootWindowHost::RootWindowHost()
     35     : delegate_(NULL) {
     36 }
     37 
     38 
     39 }  // namespace aura
     40