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

Side by Side Diff: ash/common/wallpaper/wallpaper_controller.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
OLDNEW
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/common/wallpaper/wallpaper_controller.h" 5 #include "ash/common/wallpaper/wallpaper_controller.h"
6 6
7 #include "ash/common/shell_window_ids.h" 7 #include "ash/common/shell_window_ids.h"
8 #include "ash/common/wallpaper/wallpaper_controller_observer.h" 8 #include "ash/common/wallpaper/wallpaper_controller_observer.h"
9 #include "ash/common/wallpaper/wallpaper_delegate.h" 9 #include "ash/common/wallpaper/wallpaper_delegate.h"
10 #include "ash/common/wallpaper/wallpaper_view.h" 10 #include "ash/common/wallpaper/wallpaper_view.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 if (WallpaperIsAlreadyLoaded(image, true /* compare_layouts */, layout)) { 73 if (WallpaperIsAlreadyLoaded(image, true /* compare_layouts */, layout)) {
74 VLOG(1) << "Wallpaper is already loaded"; 74 VLOG(1) << "Wallpaper is already loaded";
75 return false; 75 return false;
76 } 76 }
77 77
78 current_wallpaper_.reset(new wallpaper::WallpaperResizer( 78 current_wallpaper_.reset(new wallpaper::WallpaperResizer(
79 image, GetMaxDisplaySizeInNative(), layout, task_runner_)); 79 image, GetMaxDisplaySizeInNative(), layout, task_runner_));
80 current_wallpaper_->StartResize(); 80 current_wallpaper_->StartResize();
81 81
82 FOR_EACH_OBSERVER(WallpaperControllerObserver, observers_, 82 for (auto& observer : observers_)
83 OnWallpaperDataChanged()); 83 observer.OnWallpaperDataChanged();
84 wallpaper_mode_ = WALLPAPER_IMAGE; 84 wallpaper_mode_ = WALLPAPER_IMAGE;
85 InstallDesktopControllerForAllWindows(); 85 InstallDesktopControllerForAllWindows();
86 return true; 86 return true;
87 } 87 }
88 88
89 void WallpaperController::CreateEmptyWallpaper() { 89 void WallpaperController::CreateEmptyWallpaper() {
90 current_wallpaper_.reset(); 90 current_wallpaper_.reset();
91 wallpaper_mode_ = WALLPAPER_IMAGE; 91 wallpaper_mode_ = WALLPAPER_IMAGE;
92 InstallDesktopControllerForAllWindows(); 92 InstallDesktopControllerForAllWindows();
93 } 93 }
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 return locked ? kShellWindowId_LockScreenWallpaperContainer 244 return locked ? kShellWindowId_LockScreenWallpaperContainer
245 : kShellWindowId_WallpaperContainer; 245 : kShellWindowId_WallpaperContainer;
246 } 246 }
247 247
248 void WallpaperController::UpdateWallpaper(bool clear_cache) { 248 void WallpaperController::UpdateWallpaper(bool clear_cache) {
249 current_wallpaper_.reset(); 249 current_wallpaper_.reset();
250 WmShell::Get()->wallpaper_delegate()->UpdateWallpaper(clear_cache); 250 WmShell::Get()->wallpaper_delegate()->UpdateWallpaper(clear_cache);
251 } 251 }
252 252
253 } // namespace ash 253 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/system_tray_notifier.cc ('k') | ash/common/wm/dock/docked_window_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698