summaryrefslogtreecommitdiffstats
path: root/ash/root_window_controller.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ash/root_window_controller.cc')
-rw-r--r--ash/root_window_controller.cc22
1 files changed, 4 insertions, 18 deletions
diff --git a/ash/root_window_controller.cc b/ash/root_window_controller.cc
index 991f1eb..e4472e0d 100644
--- a/ash/root_window_controller.cc
+++ b/ash/root_window_controller.cc
@@ -166,7 +166,8 @@ RootWindowController::RootWindowController(aura::RootWindow* root_window)
: root_window_(root_window),
root_window_layout_(NULL),
shelf_(NULL),
- panel_layout_manager_(NULL) {
+ panel_layout_manager_(NULL),
+ touch_observer_hud_(NULL) {
SetRootWindowController(root_window, this);
screen_dimmer_.reset(new ScreenDimmer(root_window));
@@ -199,9 +200,6 @@ RootWindowController* RootWindowController::ForActiveRootWindow() {
}
void RootWindowController::Shutdown() {
- // Remove touch observer HUD.
- SetTouchObserverHUD(NULL);
-
CloseChildWindows();
if (Shell::GetActiveRootWindow() == root_window_) {
Shell::GetInstance()->set_active_root_window(
@@ -299,12 +297,8 @@ void RootWindowController::CreateContainers() {
// Create touch observer HUD if needed. HUD should be created after the
// containers have been created, so that its widget can be added to them.
CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kAshTouchHud)) {
- int64 id = root_window_->GetProperty(kDisplayIdKey);
- const gfx::Display& display = Shell::GetInstance()->display_manager()->
- GetDisplayForId(id);
- SetTouchObserverHUD(new TouchObserverHUD(display));
- }
+ if (command_line->HasSwitch(switches::kAshTouchHud))
+ touch_observer_hud_ = new TouchObserverHUD(root_window_.get());
}
void RootWindowController::CreateSystemBackground(
@@ -408,14 +402,6 @@ void RootWindowController::MoveWindowsTo(aura::RootWindow* dst) {
ReparentAllWindows(root_window_.get(), dst);
}
-void RootWindowController::SetTouchObserverHUD(TouchObserverHUD* hud) {
- if (touch_observer_hud_)
- root_window_->RemovePreTargetHandler(touch_observer_hud_.get());
- if (hud)
- root_window_->AddPreTargetHandler(hud);
- touch_observer_hud_.reset(hud);
-}
-
ShelfLayoutManager* RootWindowController::GetShelfLayoutManager() {
return shelf_.get() ? shelf_->shelf_layout_manager() : NULL;
}