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

Unified Diff: ash/shell.cc

Issue 11363124: Move DisplayManager and DisplayChangeObserverX11 from aura to ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: ash/shell.cc
diff --git a/ash/shell.cc b/ash/shell.cc
index 97f3c8f1bffe20c086215429e7ee2f555df9f701..28ed8970960051a269f3d7747549a8e0c3cf6e03 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -15,7 +15,7 @@
#include "ash/desktop_background/desktop_background_view.h"
#include "ash/display/display_controller.h"
#include "ash/display/mouse_cursor_event_filter.h"
-#include "ash/display/multi_display_manager.h"
+#include "ash/display/display_manager.h"
#include "ash/display/screen_position_controller.h"
#include "ash/drag_drop/drag_drop_controller.h"
#include "ash/focus_cycler.h"
@@ -67,7 +67,6 @@
#include "base/debug/leak_annotations.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/client/user_action_client.h"
-#include "ui/aura/display_manager.h"
#include "ui/aura/env.h"
#include "ui/aura/focus_manager.h"
#include "ui/aura/layout_manager.h"
@@ -94,7 +93,9 @@
#endif
#if defined(OS_CHROMEOS)
+#include "ash/display/display_change_observer_x11.h"
#include "ash/display/output_configurator_animation.h"
+#include "base/chromeos/chromeos_version.h"
#include "base/message_pump_aurax11.h"
#include "chromeos/display/output_configurator.h"
#include "content/public/browser/gpu_data_manager.h"
@@ -195,6 +196,7 @@ Shell::Shell(ShellDelegate* delegate)
browser_context_(NULL),
simulate_modal_window_open_for_testing_(false) {
DCHECK(delegate_.get());
+ display_manager_.reset(new internal::DisplayManager);
ANNOTATE_LEAKING_OBJECT_PTR(screen_); // see crbug.com/156466
gfx::Screen::SetScreenInstance(gfx::SCREEN_TYPE_ALTERNATE, screen_);
if (!gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE))
@@ -212,6 +214,10 @@ Shell::Shell(ShellDelegate* delegate)
output_configurator_->AddObserver(output_configurator_animation_.get());
base::MessagePumpAuraX11::Current()->AddDispatcherForRootWindow(
output_configurator());
+ if (base::chromeos::IsRunningOnChromeOS()) {
+ display_change_observer_.reset(new internal::DisplayChangeObserverX11);
+ display_change_observer_->NotifyDisplayChange();
+ }
#endif // defined(OS_CHROMEOS)
}
@@ -292,8 +298,6 @@ Shell::~Shell() {
// static
Shell* Shell::CreateInstance(ShellDelegate* delegate) {
CHECK(!instance_);
- aura::Env::GetInstance()->SetDisplayManager(
- new internal::MultiDisplayManager());
instance_ = new Shell(delegate);
instance_->Init();
return instance_;
@@ -603,10 +607,7 @@ void Shell::RotateFocus(Direction direction) {
void Shell::SetDisplayWorkAreaInsets(Window* contains,
const gfx::Insets& insets) {
- internal::MultiDisplayManager* display_manager =
- static_cast<internal::MultiDisplayManager*>(
- aura::Env::GetInstance()->display_manager());
- if (!display_manager->UpdateWorkAreaOfDisplayNearestWindow(contains, insets))
+ if (!display_manager_->UpdateWorkAreaOfDisplayNearestWindow(contains, insets))
return;
FOR_EACH_OBSERVER(ShellObserver, observers_,
OnDisplayWorkAreaInsetsChanged());
« ash/shell.h ('K') | « ash/shell.h ('k') | ash/system/chromeos/tray_display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698