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

Unified Diff: ash/wm/maximize_mode/workspace_backdrop_delegate.h

Issue 169643005: Adding a gray semi transparent backdrop behind the topmost window within the default container (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 6 years, 9 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/maximize_mode/workspace_backdrop_delegate.h
diff --git a/ash/wm/maximize_mode/workspace_backdrop_delegate.h b/ash/wm/maximize_mode/workspace_backdrop_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..a43a51eed36653632b77501926e74d4e73151de3
--- /dev/null
+++ b/ash/wm/maximize_mode/workspace_backdrop_delegate.h
@@ -0,0 +1,66 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_
+#define ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_
+
+#include "ash/wm/workspace/workspace_layout_manager.h"
+#include "ui/aura/window_observer.h"
+
+namespace aura {
+class Window;
+}
+
+namespace ui {
+class Layer;
+}
+
+namespace views {
+class Widget;
+}
+
+namespace ash {
+
+namespace internal {
+
+// A background which gets created for a container |window| and which gets
+// stacked behind the topmost window (within that container) covering the
+// entire container.
+class WorkspaceBackdropDelegate : public aura::WindowObserver,
+ public MaximizeBackdropDelegate {
+ public:
+ explicit WorkspaceBackdropDelegate(aura::Window* container);
+ virtual ~WorkspaceBackdropDelegate();
+
+ virtual void RestackBackdrop() OVERRIDE;
+
+ // WindowObserver overrides:
+ virtual void OnWindowBoundsChanged(aura::Window* window,
+ const gfx::Rect& old_bounds,
+ const gfx::Rect& new_bounds) OVERRIDE;
+
+ private:
+ // Position & size the background over the container window.
+ void AdjustToContainerBounds();
+
+ // Show the overlay.
+ void Show();
+
+ // The background which covers the rest of the screen.
+ views::Widget* background_;
+
+ // The window which is being "maximized".
+ aura::Window* container_;
+
+ // If true, the |RestackOrHideWindow| might recurse.
+ bool inside_;
+
+ DISALLOW_COPY_AND_ASSIGN(WorkspaceBackdropDelegate);
+};
+
+} // namespace internal
+
+} // namespace ash
+
+#endif // ASH_WM_MAXIMIZE_MODE_WORKSPACE_BACKDROP_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698