Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
|
varkha
2016/07/07 17:40:28
Talked offline about moving this to ash/common/wm.
Evan Stade
2016/07/09 00:35:05
Done.
| |
| 4 | |
| 5 #include "base/macros.h" | |
| 6 #include "ui/compositor/layer_delegate.h" | |
| 7 | |
| 8 namespace ui { | |
| 9 class Layer; | |
| 10 } | |
| 11 | |
| 12 namespace ash { | |
| 13 | |
| 14 class WmWindow; | |
| 15 | |
| 16 // A layer delegate to paint the content of a recreated layer by delegating | |
| 17 // the paint request to the original delegate. It checks if the original | |
| 18 // delegate is still valid by traversing the original layers. | |
| 19 class ForwardingLayerDelegate : public ui::LayerDelegate { | |
| 20 public: | |
| 21 ForwardingLayerDelegate(WmWindow* original_window, | |
| 22 ui::LayerDelegate* delegate); | |
| 23 ~ForwardingLayerDelegate() override; | |
| 24 | |
| 25 private: | |
| 26 // ui:LayerDelegate: | |
| 27 void OnPaintLayer(const ui::PaintContext& context) override; | |
| 28 void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override; | |
| 29 void OnDeviceScaleFactorChanged(float device_scale_factor) override; | |
| 30 base::Closure PrepareForLayerBoundsChange() override; | |
| 31 | |
| 32 bool IsDelegateValid(ui::Layer* layer); | |
| 33 | |
| 34 WmWindow* original_window_; | |
| 35 ui::LayerDelegate* original_delegate_; | |
| 36 | |
| 37 DISALLOW_COPY_AND_ASSIGN(ForwardingLayerDelegate); | |
| 38 }; | |
| 39 | |
| 40 } // namespace ash | |
| OLD | NEW |