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 |
270 void ShelfWindowWatcher::OnDisplayAdded(const gfx::Display& new_display) { | 273 void ShelfWindowWatcher::OnDisplayAdded(const gfx::Display& new_display) { |
271 // Add a new RootWindow and its ActivationClient to observed list. | 274 // Add a new RootWindow and its ActivationClient to observed list. |
272 aura::Window* root_window = Shell::GetInstance()->display_controller()-> | 275 aura::Window* root_window = Shell::GetInstance()->display_controller()-> |
273 GetRootWindowForDisplayId(new_display.id()); | 276 GetRootWindowForDisplayId(new_display.id()); |
274 | 277 |
275 // When the primary root window's display get removed, the existing root | 278 // When the primary root window's display get removed, the existing root |
276 // window is taken over by the new display and the observer is already set. | 279 // window is taken over by the new display and the observer is already set. |
277 if (!observed_root_windows_.IsObserving(root_window)) | 280 if (!observed_root_windows_.IsObserving(root_window)) |
278 OnRootWindowAdded(root_window); | 281 OnRootWindowAdded(root_window); |
279 } | 282 } |
280 | 283 |
281 void ShelfWindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) { | 284 void ShelfWindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) { |
282 // When this is called, RootWindow of |old_display| is already removed. | 285 // When this is called, RootWindow of |old_display| is already removed. |
283 // Instead, we remove an observer from RootWindow and ActivationClient in the | 286 // Instead, we remove an observer from RootWindow and ActivationClient in the |
284 // OnRootWindowDestroyed(). | 287 // OnRootWindowDestroyed(). |
285 // Do nothing here. | 288 // Do nothing here. |
286 } | 289 } |
287 | 290 |
288 void ShelfWindowWatcher::OnDisplayMetricsChanged(const gfx::Display&, | |
289 uint32_t) { | |
290 } | |
291 | |
292 } // namespace ash | 291 } // namespace ash |
OLD | NEW |