diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-17 18:24:33 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-17 18:24:33 +0000 |
commit | 55ad8c14c31df30801d8422e81b78322f95c0526 (patch) | |
tree | c0fe47685194fd2137c658944589c439d93b0c8b /ash/screen_util.h | |
parent | f3eccd0dfd02eb6b32c1a233e28439fc1a241d65 (diff) | |
download | chromium_src-55ad8c14c31df30801d8422e81b78322f95c0526.zip chromium_src-55ad8c14c31df30801d8422e81b78322f95c0526.tar.gz chromium_src-55ad8c14c31df30801d8422e81b78322f95c0526.tar.bz2 |
Screen cleanup:
* Split ScreenAsh to ScreenUtil (set of utility functions) and the screen implementation.
* moved screen_ash from Shell to DisplayManager. Ash specific imp is now hidden in DisplayManager.
* Shell now creates a separate screen object which simply keeps the list of displays for shutdown. This allow all screen operation valid during shutdown.
BUG=None
TBR=hongbo.min@intel.com,sky@chromium.org
Review URL: https://codereview.chromium.org/138003007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245562 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/screen_util.h')
-rw-r--r-- | ash/screen_util.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/ash/screen_util.h b/ash/screen_util.h new file mode 100644 index 0000000..856ef4d --- /dev/null +++ b/ash/screen_util.h @@ -0,0 +1,68 @@ +// Copyright 2014 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 ASH_SCREEN_UTIL_H_ +#define ASH_SCREEN_UTIL_H_ + +#include "ash/ash_export.h" +#include "base/basictypes.h" + +namespace aura { +class Window; +} + +namespace gfx { +class Display; +class Rect; +class Point; +} + +namespace ash { + +class ASH_EXPORT ScreenUtil { + public: + // Finds the display that contains |point| in screeen coordinates. + // Returns invalid display if there is no display that can satisfy + // the condition. + static gfx::Display FindDisplayContainingPoint(const gfx::Point& point); + + // Returns the bounds for maximized windows in parent coordinates. + // Maximized windows trigger auto-hiding the shelf. + static gfx::Rect GetMaximizedWindowBoundsInParent(aura::Window* window); + + // Returns the display bounds in parent coordinates. + static gfx::Rect GetDisplayBoundsInParent(aura::Window* window); + + // Returns the display's work area bounds in parent coordinates. + static gfx::Rect GetDisplayWorkAreaBoundsInParent(aura::Window* window); + + // TODO(oshima): Move following two to wm/coordinate_conversion.h + // Converts |rect| from |window|'s coordinates to the virtual screen + // coordinates. + static gfx::Rect ConvertRectToScreen(aura::Window* window, + const gfx::Rect& rect); + + // Converts |rect| from virtual screen coordinates to the |window|'s + // coordinates. + static gfx::Rect ConvertRectFromScreen(aura::Window* window, + const gfx::Rect& rect); + + // Returns a gfx::Display object for secondary display. Returns + // invalid display if there is no secondary display connected. + static const gfx::Display& GetSecondaryDisplay(); + + // Returns a gfx::Display object for the specified id. Returns + // invalid display if no such display is connected. + static const gfx::Display& GetDisplayForId(int64 display_id); + +private: + ScreenUtil() {} + ~ScreenUtil() {} + + DISALLOW_COPY_AND_ASSIGN(ScreenUtil); +}; + +} // namespace ash + +#endif // ASH_SCREEN_UTIL_H_ |