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

Unified Diff: ash/desktop_background/desktop_background_controller.cc

Issue 10854136: Revert 151393 - Fix white flash when user signs out and fix wallpaper animation regression (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/desktop_background/desktop_background_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/desktop_background/desktop_background_controller.cc
===================================================================
--- ash/desktop_background/desktop_background_controller.cc (revision 151397)
+++ ash/desktop_background/desktop_background_controller.cc (working copy)
@@ -106,6 +106,7 @@
desktop_background_mode_(BACKGROUND_SOLID_COLOR),
background_color_(kTransparentColor),
weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
+ InstallComponentForAllWindows();
}
DesktopBackgroundController::~DesktopBackgroundController() {
@@ -212,9 +213,22 @@
void DesktopBackgroundController::SetDesktopBackgroundSolidColorMode(
SkColor color) {
background_color_ = color;
- desktop_background_mode_ = BACKGROUND_SOLID_COLOR;
+ if (desktop_background_mode_ != BACKGROUND_SOLID_COLOR) {
+ desktop_background_mode_ = BACKGROUND_SOLID_COLOR;
+ InstallComponentForAllWindows();
+ return;
+ }
- InstallComponentForAllWindows();
+ Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ for (Shell::RootWindowList::iterator iter = root_windows.begin();
+ iter != root_windows.end(); ++iter) {
+ aura::RootWindow* root_window = *iter;
+ internal::DesktopBackgroundWidgetController* component = root_window->
+ GetProperty(internal::kWindowDesktopComponent);
+ DCHECK(component);
+ DCHECK(component->layer());
+ component->layer()->SetColor(background_color_ );
+ }
}
void DesktopBackgroundController::CreateEmptyWallpaper() {
@@ -241,13 +255,28 @@
void DesktopBackgroundController::OnWindowDestroying(aura::Window* window) {
window->SetProperty(internal::kWindowDesktopComponent,
static_cast<internal::DesktopBackgroundWidgetController*>(NULL));
- window->SetProperty(internal::kComponentWrapper,
- static_cast<internal::ComponentWrapper*>(NULL));
}
void DesktopBackgroundController::SetDesktopBackgroundImageMode() {
- desktop_background_mode_ = BACKGROUND_IMAGE;
- InstallComponentForAllWindows();
+ if (desktop_background_mode_ != BACKGROUND_IMAGE) {
+ desktop_background_mode_ = BACKGROUND_IMAGE;
+ InstallComponentForAllWindows();
+ return;
+ }
+
+ Shell::RootWindowList root_windows = Shell::GetAllRootWindows();
+ for (Shell::RootWindowList::iterator iter = root_windows.begin();
+ iter != root_windows.end(); ++iter) {
+ aura::RootWindow* root_window = *iter;
+ internal::DesktopBackgroundWidgetController* component = root_window->
+ GetProperty(internal::kWindowDesktopComponent);
+ DCHECK(component);
+ DCHECK(component->widget());
+ aura::Window* window = component->widget()->GetNativeView();
+ gfx::Rect bounds = window->bounds();
+ window->SchedulePaintInRect(gfx::Rect(0, 0,
+ bounds.width(), bounds.height()));
+ }
}
void DesktopBackgroundController::OnWallpaperLoadCompleted(
@@ -299,8 +328,7 @@
// First time for this root window
root_window->AddObserver(this);
}
- root_window->SetProperty(internal::kComponentWrapper,
- new internal::ComponentWrapper(component));
+ root_window->SetProperty(internal::kWindowDesktopComponent, component);
}
void DesktopBackgroundController::InstallComponentForAllWindows() {
« no previous file with comments | « no previous file | ash/desktop_background/desktop_background_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698