| 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 <utility> | 7 #include <utility> | 
| 8 | 8 | 
| 9 #include "ash/display/window_tree_host_manager.h" | 9 #include "ash/display/window_tree_host_manager.h" | 
| 10 #include "ash/shelf/shelf_constants.h" | 10 #include "ash/shelf/shelf_constants.h" | 
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 113       observed_root_windows_(&root_window_observer_), | 113       observed_root_windows_(&root_window_observer_), | 
| 114       observed_removed_windows_(&removed_window_observer_), | 114       observed_removed_windows_(&removed_window_observer_), | 
| 115       observed_activation_clients_(this) { | 115       observed_activation_clients_(this) { | 
| 116   // We can't assume all RootWindows have the same ActivationClient. | 116   // We can't assume all RootWindows have the same ActivationClient. | 
| 117   // Add a RootWindow and its ActivationClient to the observed list. | 117   // Add a RootWindow and its ActivationClient to the observed list. | 
| 118   aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 118   aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 
| 119   for (aura::Window::Windows::const_iterator it = root_windows.begin(); | 119   for (aura::Window::Windows::const_iterator it = root_windows.begin(); | 
| 120        it != root_windows.end(); ++it) | 120        it != root_windows.end(); ++it) | 
| 121     OnRootWindowAdded(*it); | 121     OnRootWindowAdded(*it); | 
| 122 | 122 | 
| 123   Shell::GetScreen()->AddObserver(this); | 123   gfx::Screen::GetScreen()->AddObserver(this); | 
| 124 } | 124 } | 
| 125 | 125 | 
| 126 ShelfWindowWatcher::~ShelfWindowWatcher() { | 126 ShelfWindowWatcher::~ShelfWindowWatcher() { | 
| 127   Shell::GetScreen()->RemoveObserver(this); | 127   gfx::Screen::GetScreen()->RemoveObserver(this); | 
| 128 } | 128 } | 
| 129 | 129 | 
| 130 void ShelfWindowWatcher::AddShelfItem(aura::Window* window) { | 130 void ShelfWindowWatcher::AddShelfItem(aura::Window* window) { | 
| 131   const ShelfItemDetails* item_details = | 131   const ShelfItemDetails* item_details = | 
| 132       GetShelfItemDetailsForWindow(window); | 132       GetShelfItemDetailsForWindow(window); | 
| 133   ShelfItem item; | 133   ShelfItem item; | 
| 134   ShelfID id = model_->next_id(); | 134   ShelfID id = model_->next_id(); | 
| 135   item.status = wm::IsActiveWindow(window) ? STATUS_ACTIVE: STATUS_RUNNING; | 135   item.status = wm::IsActiveWindow(window) ? STATUS_ACTIVE: STATUS_RUNNING; | 
| 136   SetShelfItemDetailsForShelfItem(&item, *item_details); | 136   SetShelfItemDetailsForShelfItem(&item, *item_details); | 
| 137   SetShelfIDForWindow(id, window); | 137   SetShelfIDForWindow(id, window); | 
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 285   // Instead, we remove an observer from RootWindow and ActivationClient in the | 285   // Instead, we remove an observer from RootWindow and ActivationClient in the | 
| 286   // OnRootWindowDestroyed(). | 286   // OnRootWindowDestroyed(). | 
| 287   // Do nothing here. | 287   // Do nothing here. | 
| 288 } | 288 } | 
| 289 | 289 | 
| 290 void ShelfWindowWatcher::OnDisplayMetricsChanged(const gfx::Display&, | 290 void ShelfWindowWatcher::OnDisplayMetricsChanged(const gfx::Display&, | 
| 291                                                  uint32_t) { | 291                                                  uint32_t) { | 
| 292 } | 292 } | 
| 293 | 293 | 
| 294 }  // namespace ash | 294 }  // namespace ash | 
| OLD | NEW | 
|---|