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/shelf/shelf_window_watcher.h" | 5 #include "ash/shelf/shelf_window_watcher.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/display/display_controller.h" | 8 #include "ash/display/display_controller.h" |
9 #include "ash/shelf/shelf_constants.h" | 9 #include "ash/shelf/shelf_constants.h" |
10 #include "ash/shelf/shelf_item_delegate_manager.h" | 10 #include "ash/shelf/shelf_item_delegate_manager.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 GetShelfItemDetailsForWindow(window); | 260 GetShelfItemDetailsForWindow(window); |
261 SetShelfItemDetailsForShelfItem(&item, *details); | 261 SetShelfItemDetailsForShelfItem(&item, *details); |
262 model_->Set(index, item); | 262 model_->Set(index, item); |
263 return; | 263 return; |
264 } | 264 } |
265 | 265 |
266 // Creates a new ShelfItem for |window|. | 266 // Creates a new ShelfItem for |window|. |
267 AddShelfItem(window); | 267 AddShelfItem(window); |
268 } | 268 } |
269 | 269 |
270 void ShelfWindowWatcher::OnDisplayBoundsChanged(const gfx::Display& display) { | |
271 } | |
272 | |
273 void ShelfWindowWatcher::OnDisplayAdded(const gfx::Display& new_display) { | 270 void ShelfWindowWatcher::OnDisplayAdded(const gfx::Display& new_display) { |
274 // Add a new RootWindow and its ActivationClient to observed list. | 271 // Add a new RootWindow and its ActivationClient to observed list. |
275 aura::Window* root_window = Shell::GetInstance()->display_controller()-> | 272 aura::Window* root_window = Shell::GetInstance()->display_controller()-> |
276 GetRootWindowForDisplayId(new_display.id()); | 273 GetRootWindowForDisplayId(new_display.id()); |
277 | 274 |
278 // When the primary root window's display get removed, the existing root | 275 // When the primary root window's display get removed, the existing root |
279 // window is taken over by the new display and the observer is already set. | 276 // window is taken over by the new display and the observer is already set. |
280 if (!observed_root_windows_.IsObserving(root_window)) | 277 if (!observed_root_windows_.IsObserving(root_window)) |
281 OnRootWindowAdded(root_window); | 278 OnRootWindowAdded(root_window); |
282 } | 279 } |
283 | 280 |
284 void ShelfWindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) { | 281 void ShelfWindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) { |
285 // When this is called, RootWindow of |old_display| is already removed. | 282 // When this is called, RootWindow of |old_display| is already removed. |
286 // Instead, we remove an observer from RootWindow and ActivationClient in the | 283 // Instead, we remove an observer from RootWindow and ActivationClient in the |
287 // OnRootWindowDestroyed(). | 284 // OnRootWindowDestroyed(). |
288 // Do nothing here. | 285 // Do nothing here. |
289 } | 286 } |
290 | 287 |
| 288 void ShelfWindowWatcher::OnDisplayMetricsChanged(const gfx::Display&, |
| 289 uint32_t) { |
| 290 } |
| 291 |
291 } // namespace ash | 292 } // namespace ash |
OLD | NEW |