Home | History | Annotate | Download | only in aura
      1 // Copyright 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 #ifndef UI_AURA_ROOT_WINDOW_HOST_OZONE_H_
      6 #define UI_AURA_ROOT_WINDOW_HOST_OZONE_H_
      7 
      8 #include <vector>
      9 
     10 #include "base/memory/scoped_ptr.h"
     11 #include "base/message_loop/message_loop.h"
     12 #include "ui/aura/root_window_host.h"
     13 #include "ui/base/ozone/event_factory_ozone.h"
     14 #include "ui/gfx/rect.h"
     15 
     16 namespace aura {
     17 
     18 class RootWindowHostOzone : public RootWindowHost,
     19                             public base::MessageLoop::Dispatcher {
     20  public:
     21   explicit RootWindowHostOzone(const gfx::Rect& bounds);
     22   virtual ~RootWindowHostOzone();
     23 
     24  private:
     25   // Overridden from Dispatcher overrides:
     26   virtual bool Dispatch(const base::NativeEvent& event) OVERRIDE;
     27 
     28   // RootWindowHost Overrides.
     29   virtual void SetDelegate(RootWindowHostDelegate* delegate) OVERRIDE;
     30   virtual RootWindow* GetRootWindow() OVERRIDE;
     31   virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
     32   virtual void Show() OVERRIDE;
     33   virtual void Hide() OVERRIDE;
     34   virtual void ToggleFullScreen() OVERRIDE;
     35   virtual gfx::Rect GetBounds() const OVERRIDE;
     36   virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
     37   virtual gfx::Insets GetInsets() const OVERRIDE;
     38   virtual void SetInsets(const gfx::Insets& bounds) OVERRIDE;
     39   virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE;
     40   virtual void SetCapture() OVERRIDE;
     41   virtual void ReleaseCapture() OVERRIDE;
     42   virtual void SetCursor(gfx::NativeCursor cursor_type) OVERRIDE;
     43   virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE;
     44   virtual bool ConfineCursorToRootWindow() OVERRIDE;
     45   virtual void UnConfineCursor() OVERRIDE;
     46   virtual void OnCursorVisibilityChanged(bool show) OVERRIDE;
     47   virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
     48   virtual void SetFocusWhenShown(bool focus_when_shown) OVERRIDE;
     49   virtual bool CopyAreaToSkCanvas(const gfx::Rect& source_bounds,
     50                                   const gfx::Point& dest_offset,
     51                                   SkCanvas* canvas) OVERRIDE;
     52   virtual void PostNativeEvent(const base::NativeEvent& event) OVERRIDE;
     53   virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
     54   virtual void PrepareForShutdown() OVERRIDE;
     55 
     56   RootWindowHostDelegate* delegate_;
     57   gfx::AcceleratedWidget widget_;
     58   gfx::Rect bounds_;
     59 
     60   // EventFactoryOzone creates converters that obtain input events from the
     61   // underlying input system and dispatch them as |ui::Event| instances into
     62   // Aura.
     63   scoped_ptr<ui::EventFactoryOzone> factory_;
     64 
     65   DISALLOW_COPY_AND_ASSIGN(RootWindowHostOzone);
     66 };
     67 
     68 }  // namespace aura
     69 
     70 #endif  // UI_AURA_ROOT_WINDOW_HOST_OZONE_H_
     71