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

Side by Side Diff: ash/desktop_background/wallpaper_resizer.cc

Issue 14305026: ash: Remove use of ALLOW_THIS_IN_INITIALIZER_LIST. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/desktop_background/wallpaper_resizer.h" 5 #include "ash/desktop_background/wallpaper_resizer.h"
6 6
7 #include "ash/desktop_background/wallpaper_resizer_observer.h" 7 #include "ash/desktop_background/wallpaper_resizer_observer.h"
8 #include "ash/root_window_controller.h" 8 #include "ash/root_window_controller.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 resized_wallpaper.setImmutable(); 88 resized_wallpaper.setImmutable();
89 origin_loop->PostTask(FROM_HERE, base::Bind(callback, resized_wallpaper)); 89 origin_loop->PostTask(FROM_HERE, base::Bind(callback, resized_wallpaper));
90 } 90 }
91 91
92 } // namespace 92 } // namespace
93 93
94 WallpaperResizer::WallpaperResizer(const WallpaperInfo& info) 94 WallpaperResizer::WallpaperResizer(const WallpaperInfo& info)
95 : wallpaper_info_(info), 95 : wallpaper_info_(info),
96 wallpaper_image_(*(ui::ResourceBundle::GetSharedInstance(). 96 wallpaper_image_(*(ui::ResourceBundle::GetSharedInstance().
97 GetImageNamed(info.idr).ToImageSkia())), 97 GetImageNamed(info.idr).ToImageSkia())),
98 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 98 weak_ptr_factory_(this) {
99 } 99 }
100 100
101 WallpaperResizer::WallpaperResizer(const WallpaperInfo& info, 101 WallpaperResizer::WallpaperResizer(const WallpaperInfo& info,
102 const gfx::ImageSkia& image) 102 const gfx::ImageSkia& image)
103 : wallpaper_info_(info), 103 : wallpaper_info_(info),
104 wallpaper_image_(image), 104 wallpaper_image_(image),
105 weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 105 weak_ptr_factory_(this) {
106 } 106 }
107 107
108 WallpaperResizer::~WallpaperResizer() { 108 WallpaperResizer::~WallpaperResizer() {
109 } 109 }
110 110
111 void WallpaperResizer::StartResize() { 111 void WallpaperResizer::StartResize() {
112 int width = 0; 112 int width = 0;
113 int height = 0; 113 int height = 0;
114 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); 114 Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
115 for (Shell::RootWindowList::iterator iter = root_windows.begin(); 115 for (Shell::RootWindowList::iterator iter = root_windows.begin();
(...skipping 29 matching lines...) Expand all
145 observers_.RemoveObserver(observer); 145 observers_.RemoveObserver(observer);
146 } 146 }
147 147
148 void WallpaperResizer::OnResizeFinished(const SkBitmap& resized_wallpaper) { 148 void WallpaperResizer::OnResizeFinished(const SkBitmap& resized_wallpaper) {
149 wallpaper_image_ = gfx::ImageSkia::CreateFrom1xBitmap(resized_wallpaper); 149 wallpaper_image_ = gfx::ImageSkia::CreateFrom1xBitmap(resized_wallpaper);
150 FOR_EACH_OBSERVER(WallpaperResizerObserver, observers_, 150 FOR_EACH_OBSERVER(WallpaperResizerObserver, observers_,
151 OnWallpaperResized()); 151 OnWallpaperResized());
152 } 152 }
153 153
154 } // namespace ash 154 } // namespace ash
OLDNEW
« no previous file with comments | « ash/desktop_background/desktop_background_controller.cc ('k') | ash/drag_drop/drag_drop_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698