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

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

Issue 201573015: Introdcue AshWindowTreeHost and move ash/chrome specific code in WTH to ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 6 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) 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/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/desktop_background/desktop_background_controller_observer.h" 8 #include "ash/desktop_background/desktop_background_controller_observer.h"
9 #include "ash/desktop_background/desktop_background_view.h" 9 #include "ash/desktop_background/desktop_background_view.h"
10 #include "ash/desktop_background/desktop_background_widget_controller.h" 10 #include "ash/desktop_background/desktop_background_widget_controller.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 Shell::RootWindowControllerList controllers = 404 Shell::RootWindowControllerList controllers =
405 Shell::GetAllRootWindowControllers(); 405 Shell::GetAllRootWindowControllers();
406 for (Shell::RootWindowControllerList::iterator iter = controllers.begin(); 406 for (Shell::RootWindowControllerList::iterator iter = controllers.begin();
407 iter != controllers.end(); ++iter) { 407 iter != controllers.end(); ++iter) {
408 RootWindowController* root_window_controller = *iter; 408 RootWindowController* root_window_controller = *iter;
409 // In the steady state (no animation playing) the background widget 409 // In the steady state (no animation playing) the background widget
410 // controller exists in the RootWindowController. 410 // controller exists in the RootWindowController.
411 DesktopBackgroundWidgetController* desktop_controller = 411 DesktopBackgroundWidgetController* desktop_controller =
412 root_window_controller->wallpaper_controller(); 412 root_window_controller->wallpaper_controller();
413 if (desktop_controller) { 413 if (desktop_controller) {
414 moved |= desktop_controller->Reparent( 414 moved |=
415 root_window_controller->root_window(), 415 desktop_controller->Reparent(root_window_controller->GetRootWindow(),
416 src_container, 416 src_container,
417 dst_container); 417 dst_container);
418 } 418 }
419 // During desktop show animations the controller lives in 419 // During desktop show animations the controller lives in
420 // AnimatingDesktopController owned by RootWindowController. 420 // AnimatingDesktopController owned by RootWindowController.
421 // NOTE: If a wallpaper load happens during a desktop show animation there 421 // NOTE: If a wallpaper load happens during a desktop show animation there
422 // can temporarily be two desktop background widgets. We must reparent 422 // can temporarily be two desktop background widgets. We must reparent
423 // both of them - one above and one here. 423 // both of them - one above and one here.
424 DesktopBackgroundWidgetController* animating_controller = 424 DesktopBackgroundWidgetController* animating_controller =
425 root_window_controller->animating_wallpaper_controller() ? 425 root_window_controller->animating_wallpaper_controller() ?
426 root_window_controller->animating_wallpaper_controller()-> 426 root_window_controller->animating_wallpaper_controller()->
427 GetController(false) : 427 GetController(false) :
428 NULL; 428 NULL;
429 if (animating_controller) { 429 if (animating_controller) {
430 moved |= animating_controller->Reparent( 430 moved |= animating_controller->Reparent(
431 root_window_controller->root_window(), 431 root_window_controller->GetRootWindow(),
432 src_container, 432 src_container,
433 dst_container); 433 dst_container);
434 } 434 }
435 } 435 }
436 return moved; 436 return moved;
437 } 437 }
438 438
439 int DesktopBackgroundController::GetBackgroundContainerId(bool locked) { 439 int DesktopBackgroundController::GetBackgroundContainerId(bool locked) {
440 return locked ? kShellWindowId_LockScreenBackgroundContainer 440 return locked ? kShellWindowId_LockScreenBackgroundContainer
441 : kShellWindowId_DesktopBackgroundContainer; 441 : kShellWindowId_DesktopBackgroundContainer;
(...skipping 23 matching lines...) Expand all
465 iter->rotation() == gfx::Display::ROTATE_270) { 465 iter->rotation() == gfx::Display::ROTATE_270) {
466 size_in_pixel = gfx::Size(size_in_pixel.height(), size_in_pixel.width()); 466 size_in_pixel = gfx::Size(size_in_pixel.height(), size_in_pixel.width());
467 } 467 }
468 width = std::max(size_in_pixel.width(), width); 468 width = std::max(size_in_pixel.width(), width);
469 height = std::max(size_in_pixel.height(), height); 469 height = std::max(size_in_pixel.height(), height);
470 } 470 }
471 return gfx::Size(width, height); 471 return gfx::Size(width, height);
472 } 472 }
473 473
474 } // namespace ash 474 } // namespace ash
OLDNEW
« no previous file with comments | « ash/cancel_mode.cc ('k') | ash/display/DEPS » ('j') | ash/display/cursor_window_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698