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

Unified Diff: ash/wm/screen_dimmer.cc

Issue 2320273002: Refactors DimWindow and moves to ash/common (Closed)
Patch Set: git add wm_window 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
Index: ash/wm/screen_dimmer.cc
diff --git a/ash/wm/screen_dimmer.cc b/ash/wm/screen_dimmer.cc
index c0bb3d84129f196706530b791342349b78474b88..7e002e52e7277b668d42c3a70cf8e35c5c19b226 100644
--- a/ash/wm/screen_dimmer.cc
+++ b/ash/wm/screen_dimmer.cc
@@ -4,9 +4,10 @@
#include "ash/wm/screen_dimmer.h"
+#include "ash/aura/wm_window_aura.h"
+#include "ash/common/wm/window_dimmer.h"
#include "ash/common/wm_shell.h"
#include "ash/shell.h"
-#include "ash/wm/dim_window.h"
#include "base/time/time.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_property.h"
@@ -91,22 +92,19 @@ void ScreenDimmer::OnRootWindowAdded(WmWindow* root_window) {
void ScreenDimmer::Update(bool should_dim) {
for (aura::Window* container : GetAllContainers(container_id_)) {
- DimWindow* dim = DimWindow::Get(container);
+ WindowDimmer* dim = WindowDimmer::Get(WmWindowAura::Get(container));
if (should_dim) {
if (!dim) {
- dim = new DimWindow(container);
+ dim = new WindowDimmer(WmWindowAura::Get(container));
James Cook 2016/09/09 00:03:36 Or maybe ScreenDimmer could store a set of WindowD
sky 2016/09/09 03:50:04 You're right that I could be more explicit and mai
dim->SetDimOpacity(target_opacity_);
}
if (at_bottom_)
- dim->parent()->StackChildAtBottom(dim);
+ dim->parent()->StackChildAtBottom(dim->window());
else
- dim->parent()->StackChildAtTop(dim);
- dim->Show();
- } else {
- if (dim) {
- dim->Hide();
- delete dim;
- }
+ dim->parent()->StackChildAtTop(dim->window());
+ dim->window()->Show();
+ } else if (dim) {
+ dim->Destroy();
}
}
}

Powered by Google App Engine
This is Rietveld 408576698