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

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

Issue 10854153: Fix memory leak on Chromium OS Heapcheck and Chromium OS (valgrind) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | ash/root_window_controller.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 (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/desktop_background/desktop_background_controller.h" 5 #include "ash/desktop_background/desktop_background_controller.h"
6 6
7 #include "ash/desktop_background/desktop_background_view.h" 7 #include "ash/desktop_background/desktop_background_view.h"
8 #include "ash/desktop_background/desktop_background_widget_controller.h" 8 #include "ash/desktop_background/desktop_background_widget_controller.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_factory.h" 10 #include "ash/shell_factory.h"
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 void DesktopBackgroundController::MoveDesktopToUnlockedContainer() { 233 void DesktopBackgroundController::MoveDesktopToUnlockedContainer() {
234 if (!locked_) 234 if (!locked_)
235 return; 235 return;
236 locked_ = false; 236 locked_ = false;
237 ReparentBackgroundWidgets(GetBackgroundContainerId(true), 237 ReparentBackgroundWidgets(GetBackgroundContainerId(true),
238 GetBackgroundContainerId(false)); 238 GetBackgroundContainerId(false));
239 } 239 }
240 240
241 void DesktopBackgroundController::OnWindowDestroying(aura::Window* window) { 241 void DesktopBackgroundController::OnWindowDestroying(aura::Window* window) {
242 window->SetProperty(internal::kWindowDesktopComponent, 242 if (window->GetProperty(internal::kComponentWrapper) &&
sky 2012/08/15 15:05:11 Why the double check here? Shouldn't you only need
bshe 2012/08/15 15:12:42 Some of the tests destroying window without even c
243 static_cast<internal::DesktopBackgroundWidgetController*>(NULL)); 243 (window->GetProperty(internal::kWindowDesktopComponent) !=
244 window->SetProperty(internal::kComponentWrapper, 244 window->GetProperty(internal::kComponentWrapper)->component()))
245 static_cast<internal::ComponentWrapper*>(NULL)); 245 delete window->GetProperty(internal::kComponentWrapper)->component();
246 window->SetProperty(internal::kWindowDesktopComponent,
247 static_cast<internal::DesktopBackgroundWidgetController*>(NULL));
248 window->SetProperty(internal::kComponentWrapper,
249 static_cast<internal::ComponentWrapper*>(NULL));
246 } 250 }
247 251
248 void DesktopBackgroundController::SetDesktopBackgroundImageMode() { 252 void DesktopBackgroundController::SetDesktopBackgroundImageMode() {
249 desktop_background_mode_ = BACKGROUND_IMAGE; 253 desktop_background_mode_ = BACKGROUND_IMAGE;
250 InstallComponentForAllWindows(); 254 InstallComponentForAllWindows();
251 } 255 }
252 256
253 void DesktopBackgroundController::OnWallpaperLoadCompleted( 257 void DesktopBackgroundController::OnWallpaperLoadCompleted(
254 scoped_refptr<WallpaperOperation> wo) { 258 scoped_refptr<WallpaperOperation> wo) {
255 current_wallpaper_.reset(wo->ReleaseWallpaperData()); 259 current_wallpaper_.reset(wo->ReleaseWallpaperData());
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 iter != root_windows.end(); ++iter) { 344 iter != root_windows.end(); ++iter) {
341 gfx::Size root_window_size = (*iter)->GetHostSize(); 345 gfx::Size root_window_size = (*iter)->GetHostSize();
342 if (root_window_size.width() > kSmallWallpaperMaximalWidth || 346 if (root_window_size.width() > kSmallWallpaperMaximalWidth ||
343 root_window_size.height() > kSmallWallpaperMaximalHeight) 347 root_window_size.height() > kSmallWallpaperMaximalHeight)
344 resolution = LARGE; 348 resolution = LARGE;
345 } 349 }
346 return resolution; 350 return resolution;
347 } 351 }
348 352
349 } // namespace ash 353 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698