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

Unified Diff: ash/desktop_background/desktop_background_view.cc

Issue 10829173: Revert 149869 because it broke ash_unittests on win_aura and linux_chromeos. (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
Index: ash/desktop_background/desktop_background_view.cc
===================================================================
--- ash/desktop_background/desktop_background_view.cc (revision 149877)
+++ ash/desktop_background/desktop_background_view.cc (working copy)
@@ -10,6 +10,7 @@
#include "ash/desktop_background/desktop_background_controller.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
+#include "ash/wm/root_window_layout_manager.h"
#include "ash/wm/window_animations.h"
#include "base/message_loop.h"
#include "base/utf_string_conversions.h"
@@ -30,10 +31,8 @@
class ShowWallpaperAnimationObserver : public ui::ImplicitAnimationObserver {
public:
ShowWallpaperAnimationObserver(aura::RootWindow* root_window,
- int container_id,
views::Widget* desktop_widget)
: root_window_(root_window),
- container_id_(container_id),
desktop_widget_(desktop_widget) {
}
@@ -43,6 +42,11 @@
private:
// Overridden from ui::ImplicitAnimationObserver:
virtual void OnImplicitAnimationsCompleted() OVERRIDE {
+ internal::RootWindowLayoutManager* root_window_layout =
+ static_cast<internal::RootWindowLayoutManager*>(
+ root_window_->layout_manager());
+ root_window_layout->SetBackgroundWidget(desktop_widget_);
+
ash::Shell::GetInstance()->
user_wallpaper_delegate()->OnWallpaperAnimationFinished();
@@ -50,7 +54,6 @@
}
aura::RootWindow* root_window_;
- int container_id_;
views::Widget* desktop_widget_;
DISALLOW_COPY_AND_ASSIGN(ShowWallpaperAnimationObserver);
@@ -135,8 +138,7 @@
Shell::GetInstance()->ShowBackgroundMenu(GetWidget(), point);
}
-views::Widget* CreateDesktopBackground(aura::RootWindow* root_window,
- int container_id) {
+void CreateDesktopBackground(aura::RootWindow* root_window) {
DesktopBackgroundController* controller = ash::Shell::GetInstance()->
desktop_background_controller();
views::Widget* desktop_widget = new views::Widget;
@@ -146,7 +148,8 @@
params.delegate = view;
if (controller->GetWallpaper().empty())
params.transparent = true;
- params.parent = root_window->GetChildById(container_id);
+ params.parent = root_window->GetChildById(
+ ash::internal::kShellWindowId_DesktopBackgroundContainer);
desktop_widget->Init(params);
desktop_widget->SetContentsView(view);
ash::WindowVisibilityAnimationType animation_type =
@@ -160,11 +163,9 @@
desktop_widget->GetNativeView()->layer()->GetAnimator());
settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION);
settings.AddObserver(new ShowWallpaperAnimationObserver(root_window,
- container_id,
desktop_widget));
desktop_widget->Show();
desktop_widget->GetNativeView()->SetName("DesktopBackgroundView");
- return desktop_widget;
}
} // namespace internal
« no previous file with comments | « ash/desktop_background/desktop_background_controller.cc ('k') | ash/desktop_background/desktop_background_widget_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698