diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-07 00:02:59 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-07 00:02:59 +0000 |
commit | 99f07e02767cdb5318a82c97c7974f0e8591c020 (patch) | |
tree | b05202037f40de0cc455033dfe57c80f786ee65d /ui/aura/root_window_host.h | |
parent | 56d7ad42237c35d2b7653c7cad89e9ca6ea75d68 (diff) | |
download | chromium_src-99f07e02767cdb5318a82c97c7974f0e8591c020.zip chromium_src-99f07e02767cdb5318a82c97c7974f0e8591c020.tar.gz chromium_src-99f07e02767cdb5318a82c97c7974f0e8591c020.tar.bz2 |
Rename Desktop->RootWindow.
BUG=none
TEST=compiles
TBR=sky
Review URL: http://codereview.chromium.org/8771015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/root_window_host.h')
-rw-r--r-- | ui/aura/root_window_host.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/ui/aura/root_window_host.h b/ui/aura/root_window_host.h new file mode 100644 index 0000000..c88097d --- /dev/null +++ b/ui/aura/root_window_host.h @@ -0,0 +1,72 @@ +// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef UI_AURA_ROOT_WINDOW_HOST_H_ +#define UI_AURA_ROOT_WINDOW_HOST_H_ +#pragma once + +#include "base/message_loop.h" +#include "ui/aura/cursor.h" +#include "ui/gfx/native_widget_types.h" + +namespace gfx { +class Point; +class Rect; +class Size; +} + +namespace aura { + +class RootWindow; + +// RootWindowHost bridges between a native window and the embedded RootWindow. +// It provides the accelerated widget and maps events from the native os to +// aura. +class RootWindowHost : public MessageLoop::Dispatcher { + public: + virtual ~RootWindowHost() {} + + // Creates a new RootWindowHost. The caller owns the returned value. + static RootWindowHost* Create(const gfx::Rect& bounds); + + // Returns the actual size of the screen. + // (gfx::Screen only reports on the virtual desktop exposed by Aura.) + static gfx::Size GetNativeScreenSize(); + + // Sets the RootWindow this RootWindowHost is hosting. RootWindowHost does not + // own the RootWindow. + virtual void SetRootWindow(RootWindow* root_window) = 0; + + // Returns the accelerated widget. + virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; + + // Shows the RootWindowHost. + virtual void Show() = 0; + + // Toggles the host's full screen state. + virtual void ToggleFullScreen() = 0; + + // Gets/Sets the size of the RootWindowHost. + virtual gfx::Size GetSize() const = 0; + virtual void SetSize(const gfx::Size& size) = 0; + + // Returns the location of the RootWindow on native screen. + virtual gfx::Point GetLocationOnNativeScreen() const = 0; + + // Sets the currently displayed cursor. + virtual void SetCursor(gfx::NativeCursor cursor) = 0; + + // Queries the mouse's current position relative to the host window. + // The position is constrained within the host window. + // You should probably call RootWindow::last_mouse_location() instead; this + // method can be expensive. + virtual gfx::Point QueryMouseLocation() = 0; + + // Posts |native_event| to the platform's event queue. + virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0; +}; + +} // namespace aura + +#endif // UI_AURA_ROOT_WINDOW_HOST_H_ |