| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 #endif | 241 #endif |
| 242 // Reset primary display to make sure that tests don't use | 242 // Reset primary display to make sure that tests don't use |
| 243 // stale display info from previous tests. | 243 // stale display info from previous tests. |
| 244 primary_display_id = gfx::Display::kInvalidDisplayID; | 244 primary_display_id = gfx::Display::kInvalidDisplayID; |
| 245 } | 245 } |
| 246 | 246 |
| 247 DisplayController::~DisplayController() { | 247 DisplayController::~DisplayController() { |
| 248 } | 248 } |
| 249 | 249 |
| 250 void DisplayController::Start() { | 250 void DisplayController::Start() { |
| 251 // Created here so that Shell has finished being created. Adds itself | |
| 252 // as a ShellObserver. | |
| 253 Shell::GetScreen()->AddObserver(this); | 251 Shell::GetScreen()->AddObserver(this); |
| 254 Shell::GetInstance()->display_manager()->set_delegate(this); | 252 Shell::GetInstance()->display_manager()->set_delegate(this); |
| 255 } | 253 } |
| 256 | 254 |
| 257 void DisplayController::Shutdown() { | 255 void DisplayController::Shutdown() { |
| 258 // Unset the display manager's delegate here because | 256 // Unset the display manager's delegate here because |
| 259 // DisplayManager outlives DisplayController. | 257 // DisplayManager outlives DisplayController. |
| 260 Shell::GetInstance()->display_manager()->set_delegate(NULL); | 258 Shell::GetInstance()->display_manager()->set_delegate(NULL); |
| 261 | 259 |
| 262 cursor_window_controller_.reset(); | 260 cursor_window_controller_.reset(); |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 std::string name = | 777 std::string name = |
| 780 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; | 778 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; |
| 781 gfx::AcceleratedWidget xwindow = | 779 gfx::AcceleratedWidget xwindow = |
| 782 root_windows[i]->GetHost()->GetAcceleratedWidget(); | 780 root_windows[i]->GetHost()->GetAcceleratedWidget(); |
| 783 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); | 781 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); |
| 784 } | 782 } |
| 785 #endif | 783 #endif |
| 786 } | 784 } |
| 787 | 785 |
| 788 } // namespace ash | 786 } // namespace ash |
| OLD | NEW |