| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/public/cpp/shelf_item.h" | 9 #include "ash/public/cpp/shelf_item.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| 11 #include "ash/shelf/shelf_model.h" | 11 #include "ash/shelf/shelf_model.h" |
| 12 #include "ash/shelf/shelf_widget.h" | 12 #include "ash/shelf/shelf_widget.h" |
| 13 #include "ash/shell.h" | 13 #include "ash/shell.h" |
| 14 #include "ash/shell/window_watcher_shelf_item_delegate.h" | 14 #include "ash/shell/window_watcher_shelf_item_delegate.h" |
| 15 #include "ash/shell_port.h" |
| 15 #include "ash/wm/window_properties.h" | 16 #include "ash/wm/window_properties.h" |
| 16 #include "ash/wm/window_util.h" | 17 #include "ash/wm/window_util.h" |
| 17 #include "ash/wm_shell.h" | |
| 18 #include "ash/wm_window.h" | 18 #include "ash/wm_window.h" |
| 19 #include "ui/aura/window.h" | 19 #include "ui/aura/window.h" |
| 20 #include "ui/aura/window_event_dispatcher.h" | 20 #include "ui/aura/window_event_dispatcher.h" |
| 21 #include "ui/display/display.h" | 21 #include "ui/display/display.h" |
| 22 | 22 |
| 23 namespace ash { | 23 namespace ash { |
| 24 namespace shell { | 24 namespace shell { |
| 25 | 25 |
| 26 class WindowWatcher::WorkspaceWindowWatcher : public aura::WindowObserver { | 26 class WindowWatcher::WorkspaceWindowWatcher : public aura::WindowObserver { |
| 27 public: | 27 public: |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 int index = model->ItemIndexByID(i->first); | 127 int index = model->ItemIndexByID(i->first); |
| 128 DCHECK_NE(-1, index); | 128 DCHECK_NE(-1, index); |
| 129 model->RemoveItemAt(index); | 129 model->RemoveItemAt(index); |
| 130 id_to_window_.erase(i); | 130 id_to_window_.erase(i); |
| 131 break; | 131 break; |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 } | 134 } |
| 135 | 135 |
| 136 void WindowWatcher::OnDisplayAdded(const display::Display& new_display) { | 136 void WindowWatcher::OnDisplayAdded(const display::Display& new_display) { |
| 137 WmWindow* root = WmShell::Get()->GetRootWindowForDisplayId(new_display.id()); | 137 WmWindow* root = |
| 138 ShellPort::Get()->GetRootWindowForDisplayId(new_display.id()); |
| 138 workspace_window_watcher_->RootWindowAdded(root->aura_window()); | 139 workspace_window_watcher_->RootWindowAdded(root->aura_window()); |
| 139 } | 140 } |
| 140 | 141 |
| 141 void WindowWatcher::OnDisplayRemoved(const display::Display& old_display) { | 142 void WindowWatcher::OnDisplayRemoved(const display::Display& old_display) { |
| 142 // All windows in the display has already been removed, so no need to | 143 // All windows in the display has already been removed, so no need to |
| 143 // remove observers. | 144 // remove observers. |
| 144 } | 145 } |
| 145 | 146 |
| 146 void WindowWatcher::OnDisplayMetricsChanged(const display::Display&, uint32_t) { | 147 void WindowWatcher::OnDisplayMetricsChanged(const display::Display&, uint32_t) { |
| 147 } | 148 } |
| 148 | 149 |
| 149 } // namespace shell | 150 } // namespace shell |
| 150 } // namespace ash | 151 } // namespace ash |
| OLD | NEW |