OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/shell/window_watcher.h" | 5 #include "ash/shell/window_watcher.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/launcher/launcher.h" | 8 #include "ash/launcher/launcher.h" |
9 #include "ash/launcher/launcher_item_delegate_manager.h" | 9 #include "ash/launcher/launcher_item_delegate_manager.h" |
10 #include "ash/launcher/launcher_model.h" | 10 #include "ash/launcher/launcher_model.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 private: | 65 private: |
66 WindowWatcher* watcher_; | 66 WindowWatcher* watcher_; |
67 | 67 |
68 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowWatcher); | 68 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowWatcher); |
69 }; | 69 }; |
70 | 70 |
71 WindowWatcher::WindowWatcher() { | 71 WindowWatcher::WindowWatcher() { |
72 workspace_window_watcher_.reset(new WorkspaceWindowWatcher(this)); | 72 workspace_window_watcher_.reset(new WorkspaceWindowWatcher(this)); |
73 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 73 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
74 for (Shell::RootWindowList::iterator iter = root_windows.begin(); | 74 for (aura::Window::Windows::iterator iter = root_windows.begin(); |
75 iter != root_windows.end(); ++ iter) { | 75 iter != root_windows.end(); ++ iter) { |
76 workspace_window_watcher_->RootWindowAdded(*iter); | 76 workspace_window_watcher_->RootWindowAdded(*iter); |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 WindowWatcher::~WindowWatcher() { | 80 WindowWatcher::~WindowWatcher() { |
81 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 81 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
82 for (Shell::RootWindowList::iterator iter = root_windows.begin(); | 82 for (aura::Window::Windows::iterator iter = root_windows.begin(); |
83 iter != root_windows.end(); ++ iter) { | 83 iter != root_windows.end(); ++ iter) { |
84 workspace_window_watcher_->RootWindowRemoved(*iter); | 84 workspace_window_watcher_->RootWindowRemoved((*iter)->GetDispatcher()); |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 aura::Window* WindowWatcher::GetWindowByID(ash::LauncherID id) { | 88 aura::Window* WindowWatcher::GetWindowByID(ash::LauncherID id) { |
89 IDToWindow::const_iterator i = id_to_window_.find(id); | 89 IDToWindow::const_iterator i = id_to_window_.find(id); |
90 return i != id_to_window_.end() ? i->second : NULL; | 90 return i != id_to_window_.end() ? i->second : NULL; |
91 } | 91 } |
92 | 92 |
93 ash::LauncherID WindowWatcher::GetIDByWindow(aura::Window* window) const { | 93 ash::LauncherID WindowWatcher::GetIDByWindow(aura::Window* window) const { |
94 for (IDToWindow::const_iterator i = id_to_window_.begin(); | 94 for (IDToWindow::const_iterator i = id_to_window_.begin(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 workspace_window_watcher_->RootWindowAdded(root); | 155 workspace_window_watcher_->RootWindowAdded(root); |
156 } | 156 } |
157 | 157 |
158 void WindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) { | 158 void WindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) { |
159 // All windows in the display has already been removed, so no need to | 159 // All windows in the display has already been removed, so no need to |
160 // remove observers. | 160 // remove observers. |
161 } | 161 } |
162 | 162 |
163 } // namespace shell | 163 } // namespace shell |
164 } // namespace ash | 164 } // namespace ash |
OLD | NEW |