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

Unified Diff: ash/desktop_background/desktop_background_view.cc

Issue 10184012: Revert 133468 - Fix wallpaper fade animation flashing problem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/desktop_background/desktop_background_controller.cc ('k') | ash/shell_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/desktop_background/desktop_background_view.cc
===================================================================
--- ash/desktop_background/desktop_background_view.cc (revision 133513)
+++ ash/desktop_background/desktop_background_view.cc (working copy)
@@ -9,48 +9,18 @@
#include "ash/ash_export.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/utf_string_conversions.h"
#include "grit/ui_resources.h"
#include "ui/aura/root_window.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
-#include "ui/gfx/compositor/layer.h"
-#include "ui/gfx/compositor/layer_animation_observer.h"
-#include "ui/gfx/compositor/scoped_layer_animation_settings.h"
#include "ui/gfx/image/image.h"
#include "ui/views/widget/widget.h"
namespace ash {
namespace internal {
-namespace {
-class ShowWallpaperAnimationObserver : public ui::ImplicitAnimationObserver {
- public:
- explicit ShowWallpaperAnimationObserver(views::Widget* desktop_widget)
- : desktop_widget_(desktop_widget) {
- }
-
- virtual ~ShowWallpaperAnimationObserver() {
- }
-
- private:
- // Overridden from ui::ImplicitAnimationObserver:
- virtual void OnImplicitAnimationsCompleted() OVERRIDE {
- internal::RootWindowLayoutManager* root_window_layout =
- Shell::GetInstance()->root_window_layout();
- root_window_layout->SetBackgroundWidget(desktop_widget_);
- delete this;
- }
-
- views::Widget* desktop_widget_;
-
- DISALLOW_COPY_AND_ASSIGN(ShowWallpaperAnimationObserver);
-};
-
-} // namespace
-
// For our scaling ratios we need to round positive numbers.
static int RoundPositive(double x) {
return static_cast<int>(floor(x + 0.5));
@@ -126,7 +96,8 @@
Shell::GetInstance()->ShowBackgroundMenu(GetWidget(), event.location());
}
-void CreateDesktopBackground(const SkBitmap& wallpaper, ImageLayout layout) {
+views::Widget* CreateDesktopBackground(const SkBitmap& wallpaper,
+ ImageLayout layout) {
views::Widget* desktop_widget = new views::Widget;
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
@@ -140,16 +111,10 @@
ash::SetWindowVisibilityAnimationType(
desktop_widget->GetNativeView(),
ash::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE);
- ash::SetWindowVisibilityAnimationTransition(
- desktop_widget->GetNativeView(),
- ash::ANIMATE_SHOW);
desktop_widget->SetBounds(params.parent->bounds());
- ui::ScopedLayerAnimationSettings settings(desktop_widget->GetNativeView()->
- layer()->GetAnimator());
- settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION);
- settings.AddObserver(new ShowWallpaperAnimationObserver(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/shell_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698