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

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

Issue 10898007: Forget about DesktopBackgroundWidget if it was deleted (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Additional check Created 8 years, 3 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/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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } 239 }
240 240
241 void DesktopBackgroundController::MoveDesktopToLockedContainer() { 241 void DesktopBackgroundController::MoveDesktopToLockedContainer() {
242 if (locked_) 242 if (locked_)
243 return; 243 return;
244 locked_ = true; 244 locked_ = true;
245 ReparentBackgroundWidgets(GetBackgroundContainerId(false), 245 ReparentBackgroundWidgets(GetBackgroundContainerId(false),
246 GetBackgroundContainerId(true)); 246 GetBackgroundContainerId(true));
247 } 247 }
248 248
249 void DesktopBackgroundController::CleanupView(aura::RootWindow* root_window) {
250 internal::ComponentWrapper *wrapper;
251 wrapper = root_window->GetProperty(internal::kComponentWrapper);
252 if (NULL == wrapper)
253 return;
254 if (wrapper->GetComponent(false))
255 wrapper->GetComponent(false)->CleanupWidget();
256 }
257
258
249 void DesktopBackgroundController::MoveDesktopToUnlockedContainer() { 259 void DesktopBackgroundController::MoveDesktopToUnlockedContainer() {
250 if (!locked_) 260 if (!locked_)
251 return; 261 return;
252 locked_ = false; 262 locked_ = false;
253 ReparentBackgroundWidgets(GetBackgroundContainerId(true), 263 ReparentBackgroundWidgets(GetBackgroundContainerId(true),
254 GetBackgroundContainerId(false)); 264 GetBackgroundContainerId(false));
255 } 265 }
256 266
257 void DesktopBackgroundController::OnWindowDestroying(aura::Window* window) { 267 void DesktopBackgroundController::OnWindowDestroying(aura::Window* window) {
258 window->SetProperty(internal::kWindowDesktopComponent, 268 window->SetProperty(internal::kWindowDesktopComponent,
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 } 369 }
360 } 370 }
361 } 371 }
362 372
363 int DesktopBackgroundController::GetBackgroundContainerId(bool locked) { 373 int DesktopBackgroundController::GetBackgroundContainerId(bool locked) {
364 return locked ? internal::kShellWindowId_LockScreenBackgroundContainer : 374 return locked ? internal::kShellWindowId_LockScreenBackgroundContainer :
365 internal::kShellWindowId_DesktopBackgroundContainer; 375 internal::kShellWindowId_DesktopBackgroundContainer;
366 } 376 }
367 377
368 } // namespace ash 378 } // namespace ash
OLDNEW
« no previous file with comments | « ash/desktop_background/desktop_background_controller.h ('k') | ash/desktop_background/desktop_background_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698