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

Unified Diff: ash/common/wm/forwarding_layer_delegate.h

Issue 2129773002: [CrOS] Initial rough cut of alt-tab window cycling UI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: function rename 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/common/ash_switches.cc ('k') | ash/common/wm/forwarding_layer_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/forwarding_layer_delegate.h
diff --git a/ash/common/wm/forwarding_layer_delegate.h b/ash/common/wm/forwarding_layer_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..f8542a3ce7d8699d63c47bf27d0b89bf62ab4649
--- /dev/null
+++ b/ash/common/wm/forwarding_layer_delegate.h
@@ -0,0 +1,48 @@
+// 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_COMMON_WM_FORWARDING_LAYER_DELEGATE_H_
+#define ASH_COMMON_WM_FORWARDING_LAYER_DELEGATE_H_
+
+#include "base/macros.h"
+#include "ui/compositor/layer_delegate.h"
+
+namespace ui {
+class Layer;
+}
+
+namespace ash {
+
+class WmWindow;
+
+namespace wm {
+
+// A layer delegate to paint the content of a recreated layer by delegating
+// the paint request to the original delegate. It checks if the original
+// delegate is still valid by traversing the original layers.
+class ForwardingLayerDelegate : public ui::LayerDelegate {
+ public:
+ ForwardingLayerDelegate(WmWindow* original_window,
+ ui::LayerDelegate* delegate);
+ ~ForwardingLayerDelegate() override;
+
+ private:
+ bool IsDelegateValid(ui::Layer* layer) const;
+
+ // ui:LayerDelegate:
+ void OnPaintLayer(const ui::PaintContext& context) override;
+ void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override;
+ void OnDeviceScaleFactorChanged(float device_scale_factor) override;
+ base::Closure PrepareForLayerBoundsChange() override;
+
+ WmWindow* original_window_;
+ ui::LayerDelegate* original_delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(ForwardingLayerDelegate);
+};
+
+} // namespace wm
+} // namespace ash
+
+#endif // ASH_COMMON_WM_FORWARDING_LAYER_DELEGATE_H_
« no previous file with comments | « ash/common/ash_switches.cc ('k') | ash/common/wm/forwarding_layer_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698