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

Unified Diff: ash/wm/window_mirror_view.h

Issue 2157393002: Moves WindowCycleList/Controller to ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback and std::move Created 4 years, 5 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/wm/window_cycle_list.cc ('k') | ash/wm/window_mirror_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_mirror_view.h
diff --git a/ash/wm/window_mirror_view.h b/ash/wm/window_mirror_view.h
new file mode 100644
index 0000000000000000000000000000000000000000..268ea10833bfa23c326e37cc636aad96c6a692cb
--- /dev/null
+++ b/ash/wm/window_mirror_view.h
@@ -0,0 +1,60 @@
+// Copyright 2016 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_WINDOW_MIRROR_VIEW_H_
+#define ASH_WM_WINDOW_MIRROR_VIEW_H_
+
+#include <memory>
+#include <vector>
+
+#include "ash/ash_export.h"
+#include "base/macros.h"
+#include "ui/views/view.h"
+#include "ui/wm/core/window_util.h"
+
+namespace ash {
+
+class WmWindowAura;
+
+namespace wm {
+
+class ForwardingLayerDelegate;
+
+// A view that mirrors a single window. Layers are lifted from the underlying
+// window (which gets new ones in their place). New paint calls, if any, are
+// forwarded to the underlying window.
+class WindowMirrorView : public views::View, public ::wm::LayerDelegateFactory {
+ public:
+ explicit WindowMirrorView(WmWindowAura* window);
+ ~WindowMirrorView() override;
+
+ void Init();
+
+ // views::View:
+ gfx::Size GetPreferredSize() const override;
+ void Layout() override;
+
+ // ::wm::LayerDelegateFactory:
+ ui::LayerDelegate* CreateDelegate(ui::LayerDelegate* delegate) override;
+
+ private:
+ // Gets the root of the layer tree that was lifted from |target_| (and is now
+ // a child of |this->layer()|).
+ ui::Layer* GetMirrorLayer();
+
+ // The original window that is being represented by |this|.
+ WmWindowAura* target_;
+
+ // Retains ownership of the mirror layer tree.
+ std::unique_ptr<ui::LayerTreeOwner> layer_owner_;
+
+ std::vector<std::unique_ptr<ForwardingLayerDelegate>> delegates_;
+
+ DISALLOW_COPY_AND_ASSIGN(WindowMirrorView);
+};
+
+} // namespace wm
+} // namespace ash
+
+#endif // ASH_WM_WINDOW_MIRROR_VIEW_H_
« no previous file with comments | « ash/wm/window_cycle_list.cc ('k') | ash/wm/window_mirror_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698