Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Side by Side Diff: ash/common/shelf/shelf_window_watcher.cc

Issue 2576023002: Fixes bug where shelf items could be added for children windows (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ash/common/shelf/shelf_window_watcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ash/common/shelf/shelf_window_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698