| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ASH_SHELL_WINDOW_WATCHER_H_ |
| 6 #define ASH_SHELL_WINDOW_WATCHER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <map> |
| 10 |
| 11 #include "ash/launcher/launcher_types.h" |
| 12 #include "base/compiler_specific.h" |
| 13 #include "base/logging.h" |
| 14 #include "ui/aura/window_observer.h" |
| 15 |
| 16 namespace aura { |
| 17 class Window; |
| 18 } |
| 19 |
| 20 namespace ash { |
| 21 namespace shell { |
| 22 |
| 23 // WindowWatcher is responsible for listening for newly created windows and |
| 24 // creating items on the Launcher for them. |
| 25 class WindowWatcher : public aura::WindowObserver { |
| 26 public: |
| 27 WindowWatcher(); |
| 28 virtual ~WindowWatcher(); |
| 29 |
| 30 aura::Window* GetWindowByID(ash::LauncherID id); |
| 31 ash::LauncherID GetIDByWindow(aura::Window* window) const; |
| 32 |
| 33 // aura::WindowObserver overrides: |
| 34 virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE; |
| 35 virtual void OnWillRemoveWindow(aura::Window* window) OVERRIDE; |
| 36 |
| 37 private: |
| 38 typedef std::map<ash::LauncherID, aura::Window*> IDToWindow; |
| 39 |
| 40 // Window watching for newly created windows to be added to. |
| 41 aura::Window* window_; |
| 42 |
| 43 // Maps from window to the id we gave it. |
| 44 IDToWindow id_to_window_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(WindowWatcher); |
| 47 }; |
| 48 |
| 49 } // namespace shell |
| 50 } // namespace ash |
| 51 |
| 52 #endif // ASH_SHELL_WINDOW_WATCHER_H_ |
| OLD | NEW |