Index: ash/desktop_background/desktop_background_controller.cc |
diff --git a/ash/desktop_background/desktop_background_controller.cc b/ash/desktop_background/desktop_background_controller.cc |
index 2d49b4d18cd27d7c67b7d577080e3b74d7c976d5..3db42ec58b8ac0df8a65d52d13ab9fd8531e298a 100644 |
--- a/ash/desktop_background/desktop_background_controller.cc |
+++ b/ash/desktop_background/desktop_background_controller.cc |
@@ -106,7 +106,6 @@ DesktopBackgroundController::DesktopBackgroundController() |
desktop_background_mode_(BACKGROUND_SOLID_COLOR), |
background_color_(kTransparentColor), |
weak_ptr_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
- InstallComponentForAllWindows(); |
} |
DesktopBackgroundController::~DesktopBackgroundController() { |
@@ -213,22 +212,10 @@ void DesktopBackgroundController::CancelPendingWallpaperOperation() { |
void DesktopBackgroundController::SetDesktopBackgroundSolidColorMode( |
SkColor color) { |
background_color_ = color; |
- if (desktop_background_mode_ != BACKGROUND_SOLID_COLOR) { |
+ if (desktop_background_mode_ != BACKGROUND_SOLID_COLOR) |
desktop_background_mode_ = BACKGROUND_SOLID_COLOR; |
- 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->layer()); |
- component->layer()->SetColor(background_color_ ); |
- } |
+ InstallComponentForAllWindows(); |
} |
void DesktopBackgroundController::CreateEmptyWallpaper() { |
@@ -255,28 +242,15 @@ void DesktopBackgroundController::MoveDesktopToUnlockedContainer() { |
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() { |
if (desktop_background_mode_ != BACKGROUND_IMAGE) { |
sky
2012/08/13 17:31:05
Do you even need the if now?
bshe
2012/08/13 18:28:22
No need. Removed it.
On 2012/08/13 17:31:05, sky
|
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())); |
} |
+ InstallComponentForAllWindows(); |
} |
void DesktopBackgroundController::OnWallpaperLoadCompleted( |
@@ -328,7 +302,8 @@ void DesktopBackgroundController::InstallComponent( |
// First time for this root window |
root_window->AddObserver(this); |
} |
- root_window->SetProperty(internal::kWindowDesktopComponent, component); |
+ root_window->SetProperty(internal::kComponentWrapper, |
+ new internal::ComponentWrapper(component)); |
} |
void DesktopBackgroundController::InstallComponentForAllWindows() { |