Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1813)

Unified Diff: ash/screen_ash.cc

Issue 11363124: Move DisplayManager and DisplayChangeObserverX11 from aura to ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix rebase Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/screen_ash.h ('k') | ash/shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/screen_ash.cc
diff --git a/ash/screen_ash.cc b/ash/screen_ash.cc
index e5417a2604a1d3830772fc8564e68e25dd04cf73..fa9a986589169c8bf7d39d055dd560719ad55aa6 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
« no previous file with comments | « ash/screen_ash.h ('k') | ash/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698