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

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

Issue 10915046: Revert 154611 - "Forget about DesktopBackgroundView if it was deleted" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | Annotate | Revision Log
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
259 void DesktopBackgroundController::MoveDesktopToUnlockedContainer() { 249 void DesktopBackgroundController::MoveDesktopToUnlockedContainer() {
260 if (!locked_) 250 if (!locked_)
261 return; 251 return;
262 locked_ = false; 252 locked_ = false;
263 ReparentBackgroundWidgets(GetBackgroundContainerId(true), 253 ReparentBackgroundWidgets(GetBackgroundContainerId(true),
264 GetBackgroundContainerId(false)); 254 GetBackgroundContainerId(false));
265 } 255 }
266 256
267 void DesktopBackgroundController::OnWindowDestroying(aura::Window* window) { 257 void DesktopBackgroundController::OnWindowDestroying(aura::Window* window) {
268 window->SetProperty(internal::kWindowDesktopComponent, 258 window->SetProperty(internal::kWindowDesktopComponent,
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 } 359 }
370 } 360 }
371 } 361 }
372 362
373 int DesktopBackgroundController::GetBackgroundContainerId(bool locked) { 363 int DesktopBackgroundController::GetBackgroundContainerId(bool locked) {
374 return locked ? internal::kShellWindowId_LockScreenBackgroundContainer : 364 return locked ? internal::kShellWindowId_LockScreenBackgroundContainer :
375 internal::kShellWindowId_DesktopBackgroundContainer; 365 internal::kShellWindowId_DesktopBackgroundContainer;
376 } 366 }
377 367
378 } // namespace ash 368 } // 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