| 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/common/shelf/shelf_window_watcher.h" | 5 #include "ash/common/shelf/shelf_window_watcher.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "ash/common/shelf/shelf_constants.h" | 10 #include "ash/common/shelf/shelf_constants.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 | 94 |
| 95 void ShelfWindowWatcher::UserWindowObserver::OnWindowDestroying( | 95 void ShelfWindowWatcher::UserWindowObserver::OnWindowDestroying( |
| 96 WmWindow* window) { | 96 WmWindow* window) { |
| 97 window_watcher_->OnUserWindowDestroying(window); | 97 window_watcher_->OnUserWindowDestroying(window); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void ShelfWindowWatcher::UserWindowObserver::OnWindowVisibilityChanged( | 100 void ShelfWindowWatcher::UserWindowObserver::OnWindowVisibilityChanged( |
| 101 WmWindow* window, | 101 WmWindow* window, |
| 102 bool visible) { | 102 bool visible) { |
| 103 // OnWindowVisibilityChanged() is called for descendants too. We only care |
| 104 // about changes to the visibility of windows we know about. |
| 105 if (!window_watcher_->observed_user_windows_.IsObserving(window)) |
| 106 return; |
| 107 |
| 103 // The tooltip behavior for panel windows depends on the panel visibility. | 108 // The tooltip behavior for panel windows depends on the panel visibility. |
| 104 window_watcher_->OnUserWindowPropertyChanged(window); | 109 window_watcher_->OnUserWindowPropertyChanged(window); |
| 105 } | 110 } |
| 106 | 111 |
| 107 //////////////////////////////////////////////////////////////////////////////// | 112 //////////////////////////////////////////////////////////////////////////////// |
| 108 | 113 |
| 109 ShelfWindowWatcher::ShelfWindowWatcher(ShelfModel* model) | 114 ShelfWindowWatcher::ShelfWindowWatcher(ShelfModel* model) |
| 110 : model_(model), | 115 : model_(model), |
| 111 container_window_observer_(this), | 116 container_window_observer_(this), |
| 112 user_window_observer_(this), | 117 user_window_observer_(this), |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 observed_container_windows_.Add(panel_container); | 230 observed_container_windows_.Add(panel_container); |
| 226 } | 231 } |
| 227 | 232 |
| 228 void ShelfWindowWatcher::OnDisplayRemoved(const display::Display& old_display) { | 233 void ShelfWindowWatcher::OnDisplayRemoved(const display::Display& old_display) { |
| 229 } | 234 } |
| 230 | 235 |
| 231 void ShelfWindowWatcher::OnDisplayMetricsChanged(const display::Display&, | 236 void ShelfWindowWatcher::OnDisplayMetricsChanged(const display::Display&, |
| 232 uint32_t) {} | 237 uint32_t) {} |
| 233 | 238 |
| 234 } // namespace ash | 239 } // namespace ash |
| OLD | NEW |