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

Unified Diff: ash/common/wm_root_window_controller.cc

Issue 2318223003: mash: Migrate wallpaper controllers to ash/common. (Closed)
Patch Set: Fix nit. Created 4 years, 3 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/common/wm_root_window_controller.h ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm_root_window_controller.cc
diff --git a/ash/common/wm_root_window_controller.cc b/ash/common/wm_root_window_controller.cc
index f4875927196eb4f14d93dfe2371a6c8ef0c74a51..00a81ad82edfaff456e93114f06fa292dcc915d6 100644
--- a/ash/common/wm_root_window_controller.cc
+++ b/ash/common/wm_root_window_controller.cc
@@ -5,6 +5,8 @@
#include "ash/common/wm_root_window_controller.h"
#include "ash/common/shell_window_ids.h"
+#include "ash/common/wallpaper/wallpaper_delegate.h"
+#include "ash/common/wallpaper/wallpaper_widget_controller.h"
#include "ash/common/wm/root_window_layout_manager.h"
#include "ash/common/wm/workspace/workspace_layout_manager.h"
#include "ash/common/wm/workspace_controller.h"
@@ -31,13 +33,45 @@ WmWindow* CreateContainer(int window_id, const char* name, WmWindow* parent) {
WmRootWindowController::WmRootWindowController(WmWindow* root)
: root_(root), root_window_layout_manager_(nullptr) {}
-WmRootWindowController::~WmRootWindowController() {}
+WmRootWindowController::~WmRootWindowController() {
+ if (animating_wallpaper_widget_controller_.get())
+ animating_wallpaper_widget_controller_->StopAnimating();
+}
+
+void WmRootWindowController::SetWallpaperWidgetController(
+ WallpaperWidgetController* controller) {
+ wallpaper_widget_controller_.reset(controller);
+}
+
+void WmRootWindowController::SetAnimatingWallpaperWidgetController(
+ AnimatingWallpaperWidgetController* controller) {
+ if (animating_wallpaper_widget_controller_.get())
+ animating_wallpaper_widget_controller_->StopAnimating();
+ animating_wallpaper_widget_controller_.reset(controller);
+}
wm::WorkspaceWindowState WmRootWindowController::GetWorkspaceWindowState() {
return workspace_controller_ ? workspace_controller()->GetWindowState()
: wm::WORKSPACE_WINDOW_STATE_DEFAULT;
}
+void WmRootWindowController::OnInitialWallpaperAnimationStarted() {}
+
+void WmRootWindowController::OnWallpaperAnimationFinished(
+ views::Widget* widget) {
+ WmShell::Get()->wallpaper_delegate()->OnWallpaperAnimationFinished();
+ // Only removes old component when wallpaper animation finished. If we
+ // remove the old one before the new wallpaper is done fading in there will
+ // be a white flash during the animation.
+ if (animating_wallpaper_widget_controller()) {
+ WallpaperWidgetController* controller =
+ animating_wallpaper_widget_controller()->GetController(true);
+ DCHECK_EQ(controller->widget(), widget);
+ // Release the old controller and close its wallpaper widget.
+ SetWallpaperWidgetController(controller);
+ }
+}
+
void WmRootWindowController::CreateContainers() {
// These containers are just used by PowerButtonController to animate groups
// of containers simultaneously without messing up the current transformations
« no previous file with comments | « ash/common/wm_root_window_controller.h ('k') | ash/common/wm_shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698