diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 10:10:58 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-14 10:10:58 +0000 |
commit | 6bdf795e8f7dcfe80dd33b06bab229fd8a4d49f9 (patch) | |
tree | 842af6ec5fd894feb6b1d6cad3c38c4682966c57 /ash/screen_ash.cc | |
parent | 647aeccd73b8598e1373987d34e7f16a6d5b39b7 (diff) | |
download | chromium_src-6bdf795e8f7dcfe80dd33b06bab229fd8a4d49f9.zip chromium_src-6bdf795e8f7dcfe80dd33b06bab229fd8a4d49f9.tar.gz chromium_src-6bdf795e8f7dcfe80dd33b06bab229fd8a4d49f9.tar.bz2 |
- Move DisplayManager and DisplayChangeObserverX11 from aura
to ash.DisplayManager/DisplayChangeObserverX11 are in aura for
historical reason, but they no longer have to be in aura.
* Remove SingleDisplayManager as it's no longer necessary.
* Rename MultipleDisplayManager and consolidate into DisplayManager.
* Remove DisplayManager from desktop environment. Screen
information is managed by platform in desktop environment, and
should be provided via gfx::Screen implementation.
- Move DisplayObserver to ui/gfx. This should be consolicated
with other similar features such as WorkAreaWatcherObserver/
DisplaySettingsProvider. It's tracked in crbug.com/122863.
- Misc cleanups
* Test should use test_support_ash instead of including
individual files.
* Use TestScreen where appropriate.
BUG=159710, 122863
TEST=none
Review URL: https://chromiumcodereview.appspot.com/11363124
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167639 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/screen_ash.cc')
-rw-r--r-- | ash/screen_ash.cc | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/ash/screen_ash.cc b/ash/screen_ash.cc index e5417a2..fa9a986 100644 --- a/ash/screen_ash.cc +++ b/ash/screen_ash.cc @@ -5,7 +5,7 @@ #include "ash/screen_ash.h" #include "ash/display/display_controller.h" -#include "ash/display/multi_display_manager.h" +#include "ash/display/display_manager.h" #include "ash/root_window_controller.h" #include "ash/shell.h" #include "ash/wm/property_util.h" @@ -14,7 +14,6 @@ #include "base/logging.h" #include "ui/aura/client/screen_position_client.h" #include "ui/aura/env.h" -#include "ui/aura/display_manager.h" #include "ui/aura/root_window.h" #include "ui/gfx/display.h" #include "ui/gfx/screen.h" @@ -22,9 +21,8 @@ namespace ash { namespace { -internal::MultiDisplayManager* GetDisplayManager() { - return static_cast<internal::MultiDisplayManager*>( - aura::Env::GetInstance()->display_manager()); +internal::DisplayManager* GetDisplayManager() { + return Shell::GetInstance()->display_manager(); } } // namespace @@ -89,6 +87,20 @@ const gfx::Display& ScreenAsh::GetDisplayForId(int64 display_id) { return GetDisplayManager()->GetDisplayForId(display_id); } +void ScreenAsh::NotifyBoundsChanged(const gfx::Display& display) { + FOR_EACH_OBSERVER(gfx::DisplayObserver, observers_, + OnDisplayBoundsChanged(display)); +} + +void ScreenAsh::NotifyDisplayAdded(const gfx::Display& display) { + FOR_EACH_OBSERVER(gfx::DisplayObserver, observers_, OnDisplayAdded(display)); +} + +void ScreenAsh::NotifyDisplayRemoved(const gfx::Display& display) { + FOR_EACH_OBSERVER( + gfx::DisplayObserver, observers_, OnDisplayRemoved(display)); +} + bool ScreenAsh::IsDIPEnabled() { return true; } @@ -122,4 +134,12 @@ gfx::Display ScreenAsh::GetPrimaryDisplay() const { return DisplayController::GetPrimaryDisplay(); } +void ScreenAsh::AddObserver(gfx::DisplayObserver* observer) { + observers_.AddObserver(observer); +} + +void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { + observers_.RemoveObserver(observer); +} + } // namespace ash |