| 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 #ifndef ASH_SHELF_SHELF_WINDOW_WATCHER_H_ | 5 #ifndef ASH_SHELF_SHELF_WINDOW_WATCHER_H_ |
| 6 #define ASH_SHELF_SHELF_WINDOW_WATCHER_H_ | 6 #define ASH_SHELF_SHELF_WINDOW_WATCHER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(UserWindowObserver); | 67 DISALLOW_COPY_AND_ASSIGN(UserWindowObserver); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 // Creates a ShelfItem for |window|. | 70 // Creates a ShelfItem for |window|. |
| 71 void AddShelfItem(aura::Window* window); | 71 void AddShelfItem(aura::Window* window); |
| 72 | 72 |
| 73 // Removes a ShelfItem for |window|. | 73 // Removes a ShelfItem for |window|. |
| 74 void RemoveShelfItem(aura::Window* window); | 74 void RemoveShelfItem(aura::Window* window); |
| 75 | 75 |
| 76 // Returns the index of ShelfItem associated with |window|, or -1 if none. | |
| 77 int GetShelfItemIndexForWindow(aura::Window* window) const; | |
| 78 | |
| 79 // Cleans up observers on |container|. | 76 // Cleans up observers on |container|. |
| 80 void OnContainerWindowDestroying(aura::Window* container); | 77 void OnContainerWindowDestroying(aura::Window* container); |
| 81 | 78 |
| 82 // Adds a shelf item for new windows added to the default container that have | 79 // Adds a shelf item for new windows added to the default container that have |
| 83 // a valid ShelfItemType property value. | 80 // a valid ShelfItemType property value. |
| 84 void OnUserWindowAdded(aura::Window* window); | 81 void OnUserWindowAdded(aura::Window* window); |
| 85 | 82 |
| 86 // Adds, updates or removes the shelf item based on a property change. | 83 // Adds, updates or removes the shelf item based on a property change. |
| 87 void OnUserWindowPropertyChanged(aura::Window* window); | 84 void OnUserWindowPropertyChanged(aura::Window* window); |
| 88 | 85 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 111 | 108 |
| 112 // The set of windows with shelf items managed by this ShelfWindowWatcher. | 109 // The set of windows with shelf items managed by this ShelfWindowWatcher. |
| 113 std::set<aura::Window*> user_windows_with_items_; | 110 std::set<aura::Window*> user_windows_with_items_; |
| 114 | 111 |
| 115 DISALLOW_COPY_AND_ASSIGN(ShelfWindowWatcher); | 112 DISALLOW_COPY_AND_ASSIGN(ShelfWindowWatcher); |
| 116 }; | 113 }; |
| 117 | 114 |
| 118 } // namespace ash | 115 } // namespace ash |
| 119 | 116 |
| 120 #endif // ASH_SHELF_SHELF_WINDOW_WATCHER_H_ | 117 #endif // ASH_SHELF_SHELF_WINDOW_WATCHER_H_ |
| OLD | NEW |