| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/resolution_notification_controller.h" | 5 #include "ash/display/resolution_notification_controller.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/display/display_info.h" | 9 #include "ash/display/display_info.h" |
| 10 #include "ash/display/display_manager.h" | 10 #include "ash/display/display_manager.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 timeout_count = kTimeoutInSec; | 145 timeout_count = kTimeoutInSec; |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 | 148 |
| 149 ResolutionNotificationController::ResolutionChangeInfo:: | 149 ResolutionNotificationController::ResolutionChangeInfo:: |
| 150 ~ResolutionChangeInfo() { | 150 ~ResolutionChangeInfo() { |
| 151 } | 151 } |
| 152 | 152 |
| 153 ResolutionNotificationController::ResolutionNotificationController() { | 153 ResolutionNotificationController::ResolutionNotificationController() { |
| 154 Shell::GetInstance()->window_tree_host_manager()->AddObserver(this); | 154 Shell::GetInstance()->window_tree_host_manager()->AddObserver(this); |
| 155 Shell::GetScreen()->AddObserver(this); | 155 gfx::Screen::GetScreen()->AddObserver(this); |
| 156 } | 156 } |
| 157 | 157 |
| 158 ResolutionNotificationController::~ResolutionNotificationController() { | 158 ResolutionNotificationController::~ResolutionNotificationController() { |
| 159 Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this); | 159 Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this); |
| 160 Shell::GetScreen()->RemoveObserver(this); | 160 gfx::Screen::GetScreen()->RemoveObserver(this); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void ResolutionNotificationController::PrepareNotification( | 163 void ResolutionNotificationController::PrepareNotification( |
| 164 int64_t display_id, | 164 int64_t display_id, |
| 165 const DisplayMode& old_resolution, | 165 const DisplayMode& old_resolution, |
| 166 const DisplayMode& new_resolution, | 166 const DisplayMode& new_resolution, |
| 167 const base::Closure& accept_callback) { | 167 const base::Closure& accept_callback) { |
| 168 DCHECK(!gfx::Display::IsInternalDisplayId(display_id)); | 168 DCHECK(!gfx::Display::IsInternalDisplayId(display_id)); |
| 169 // If multiple resolution changes are invoked for the same display, | 169 // If multiple resolution changes are invoked for the same display, |
| 170 // the original resolution for the first resolution change has to be used | 170 // the original resolution for the first resolution change has to be used |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 this, | 303 this, |
| 304 &ResolutionNotificationController::OnTimerTick); | 304 &ResolutionNotificationController::OnTimerTick); |
| 305 } | 305 } |
| 306 } | 306 } |
| 307 | 307 |
| 308 void ResolutionNotificationController::SuppressTimerForTest() { | 308 void ResolutionNotificationController::SuppressTimerForTest() { |
| 309 g_use_timer = false; | 309 g_use_timer = false; |
| 310 } | 310 } |
| 311 | 311 |
| 312 } // namespace ash | 312 } // namespace ash |
| OLD | NEW |