OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/screen_ash.h" | 5 #include "ash/display/screen_ash.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
9 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
10 #include "ash/root_window_settings.h" | 10 #include "ash/root_window_settings.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 return display_manager->GetDisplayAt(0).id() == | 181 return display_manager->GetDisplayAt(0).id() == |
182 Shell::GetScreen()->GetPrimaryDisplay().id() ? | 182 Shell::GetScreen()->GetPrimaryDisplay().id() ? |
183 display_manager->GetDisplayAt(1) : display_manager->GetDisplayAt(0); | 183 display_manager->GetDisplayAt(1) : display_manager->GetDisplayAt(0); |
184 } | 184 } |
185 | 185 |
186 // static | 186 // static |
187 const gfx::Display& ScreenAsh::GetDisplayForId(int64 display_id) { | 187 const gfx::Display& ScreenAsh::GetDisplayForId(int64 display_id) { |
188 return GetDisplayManager()->GetDisplayForId(display_id); | 188 return GetDisplayManager()->GetDisplayForId(display_id); |
189 } | 189 } |
190 | 190 |
191 void ScreenAsh::NotifyMetricsChanged(const gfx::Display& display, | 191 void ScreenAsh::NotifyBoundsChanged(const gfx::Display& display) { |
192 uint32_t metrics) { | 192 FOR_EACH_OBSERVER(gfx::DisplayObserver, observers_, |
193 FOR_EACH_OBSERVER(gfx::DisplayObserver, | 193 OnDisplayBoundsChanged(display)); |
194 observers_, | |
195 OnDisplayMetricsChanged(display, metrics)); | |
196 } | 194 } |
197 | 195 |
198 void ScreenAsh::NotifyDisplayAdded(const gfx::Display& display) { | 196 void ScreenAsh::NotifyDisplayAdded(const gfx::Display& display) { |
199 FOR_EACH_OBSERVER(gfx::DisplayObserver, observers_, OnDisplayAdded(display)); | 197 FOR_EACH_OBSERVER(gfx::DisplayObserver, observers_, OnDisplayAdded(display)); |
200 } | 198 } |
201 | 199 |
202 void ScreenAsh::NotifyDisplayRemoved(const gfx::Display& display) { | 200 void ScreenAsh::NotifyDisplayRemoved(const gfx::Display& display) { |
203 FOR_EACH_OBSERVER( | 201 FOR_EACH_OBSERVER( |
204 gfx::DisplayObserver, observers_, OnDisplayRemoved(display)); | 202 gfx::DisplayObserver, observers_, OnDisplayRemoved(display)); |
205 } | 203 } |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 | 279 |
282 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { | 280 void ScreenAsh::RemoveObserver(gfx::DisplayObserver* observer) { |
283 observers_.RemoveObserver(observer); | 281 observers_.RemoveObserver(observer); |
284 } | 282 } |
285 | 283 |
286 gfx::Screen* ScreenAsh::CloneForShutdown() { | 284 gfx::Screen* ScreenAsh::CloneForShutdown() { |
287 return new ScreenForShutdown(this); | 285 return new ScreenForShutdown(this); |
288 } | 286 } |
289 | 287 |
290 } // namespace ash | 288 } // namespace ash |
OLD | NEW |