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

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

Issue 2414303002: Remove usage of FOR_EACH_OBSERVER macro in ash/common (Closed)
Patch Set: Created 4 years, 2 months 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 | « ash/common/shelf/shelf_model.cc ('k') | ash/common/system/chromeos/network/vpn_delegate.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/wm_shelf.h" 5 #include "ash/common/shelf/wm_shelf.h"
6 6
7 #include "ash/common/shelf/shelf_controller.h" 7 #include "ash/common/shelf/shelf_controller.h"
8 #include "ash/common/shelf/shelf_delegate.h" 8 #include "ash/common/shelf/shelf_delegate.h"
9 #include "ash/common/shelf/shelf_item_delegate.h" 9 #include "ash/common/shelf/shelf_item_delegate.h"
10 #include "ash/common/shelf/shelf_layout_manager.h" 10 #include "ash/common/shelf/shelf_layout_manager.h"
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 276
277 void WmShelf::AddObserver(WmShelfObserver* observer) { 277 void WmShelf::AddObserver(WmShelfObserver* observer) {
278 observers_.AddObserver(observer); 278 observers_.AddObserver(observer);
279 } 279 }
280 280
281 void WmShelf::RemoveObserver(WmShelfObserver* observer) { 281 void WmShelf::RemoveObserver(WmShelfObserver* observer) {
282 observers_.RemoveObserver(observer); 282 observers_.RemoveObserver(observer);
283 } 283 }
284 284
285 void WmShelf::NotifyShelfIconPositionsChanged() { 285 void WmShelf::NotifyShelfIconPositionsChanged() {
286 FOR_EACH_OBSERVER(WmShelfObserver, observers_, OnShelfIconPositionsChanged()); 286 for (auto& observer : observers_)
287 observer.OnShelfIconPositionsChanged();
287 } 288 }
288 289
289 StatusAreaWidget* WmShelf::GetStatusAreaWidget() const { 290 StatusAreaWidget* WmShelf::GetStatusAreaWidget() const {
290 return shelf_widget_->status_area_widget(); 291 return shelf_widget_->status_area_widget();
291 } 292 }
292 293
293 void WmShelf::SetVirtualKeyboardBoundsForTesting(const gfx::Rect& bounds) { 294 void WmShelf::SetVirtualKeyboardBoundsForTesting(const gfx::Rect& bounds) {
294 shelf_layout_manager_->OnKeyboardBoundsChanging(bounds); 295 shelf_layout_manager_->OnKeyboardBoundsChanging(bounds);
295 } 296 }
296 297
297 ShelfLockingManager* WmShelf::GetShelfLockingManagerForTesting() { 298 ShelfLockingManager* WmShelf::GetShelfLockingManagerForTesting() {
298 return shelf_locking_manager_.get(); 299 return shelf_locking_manager_.get();
299 } 300 }
300 301
301 ShelfView* WmShelf::GetShelfViewForTesting() { 302 ShelfView* WmShelf::GetShelfViewForTesting() {
302 return shelf_view_; 303 return shelf_view_;
303 } 304 }
304 305
305 WmShelf::WmShelf() {} 306 WmShelf::WmShelf() {}
306 307
307 WmShelf::~WmShelf() {} 308 WmShelf::~WmShelf() {}
308 309
309 void WmShelf::WillDeleteShelfLayoutManager() { 310 void WmShelf::WillDeleteShelfLayoutManager() {
310 DCHECK(shelf_layout_manager_); 311 DCHECK(shelf_layout_manager_);
311 shelf_layout_manager_->RemoveObserver(this); 312 shelf_layout_manager_->RemoveObserver(this);
312 shelf_layout_manager_ = nullptr; 313 shelf_layout_manager_ = nullptr;
313 } 314 }
314 315
315 void WmShelf::WillChangeVisibilityState(ShelfVisibilityState new_state) { 316 void WmShelf::WillChangeVisibilityState(ShelfVisibilityState new_state) {
316 FOR_EACH_OBSERVER(WmShelfObserver, observers_, 317 for (auto& observer : observers_)
317 WillChangeVisibilityState(new_state)); 318 observer.WillChangeVisibilityState(new_state);
318 } 319 }
319 320
320 void WmShelf::OnAutoHideStateChanged(ShelfAutoHideState new_state) { 321 void WmShelf::OnAutoHideStateChanged(ShelfAutoHideState new_state) {
321 FOR_EACH_OBSERVER(WmShelfObserver, observers_, 322 for (auto& observer : observers_)
322 OnAutoHideStateChanged(new_state)); 323 observer.OnAutoHideStateChanged(new_state);
323 } 324 }
324 325
325 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type, 326 void WmShelf::OnBackgroundUpdated(ShelfBackgroundType background_type,
326 BackgroundAnimatorChangeType change_type) { 327 BackgroundAnimatorChangeType change_type) {
327 if (background_type == GetBackgroundType()) 328 if (background_type == GetBackgroundType())
328 return; 329 return;
329 FOR_EACH_OBSERVER(WmShelfObserver, observers_, 330 for (auto& observer : observers_)
330 OnBackgroundTypeChanged(background_type, change_type)); 331 observer.OnBackgroundTypeChanged(background_type, change_type);
331 } 332 }
332 333
333 } // namespace ash 334 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/shelf/shelf_model.cc ('k') | ash/common/system/chromeos/network/vpn_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698