| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/mus/frame/custom_frame_view_mus.h" | 5 #include "ash/mus/frame/custom_frame_view_mus.h" |
| 6 | 6 |
| 7 #include "ui/compositor/paint_cache.h" | 7 #include "ui/compositor/paint_cache.h" |
| 8 #include "ui/compositor/paint_recorder.h" | 8 #include "ui/compositor/paint_recorder.h" |
| 9 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 namespace mus { | 12 namespace mus { |
| 13 | 13 |
| 14 CustomFrameViewMus::CustomFrameViewMus( | 14 CustomFrameViewMus::CustomFrameViewMus( |
| 15 views::Widget* widget, | 15 views::Widget* widget, |
| 16 ImmersiveFullscreenControllerDelegate* immersive_delegate, | 16 ImmersiveFullscreenControllerDelegate* immersive_delegate, |
| 17 bool enable_immersive) | 17 bool enable_immersive, |
| 18 : CustomFrameViewAsh(widget, immersive_delegate, enable_immersive) {} | 18 mojom::WindowStyle window_style) |
| 19 : CustomFrameViewAsh(widget, |
| 20 immersive_delegate, |
| 21 enable_immersive, |
| 22 window_style) {} |
| 19 | 23 |
| 20 CustomFrameViewMus::~CustomFrameViewMus() {} | 24 CustomFrameViewMus::~CustomFrameViewMus() {} |
| 21 | 25 |
| 22 void CustomFrameViewMus::OnPaint(gfx::Canvas* canvas) { | 26 void CustomFrameViewMus::OnPaint(gfx::Canvas* canvas) { |
| 23 canvas->Save(); | 27 canvas->Save(); |
| 24 CustomFrameViewAsh::OnPaint(canvas); | 28 CustomFrameViewAsh::OnPaint(canvas); |
| 25 canvas->Restore(); | 29 canvas->Restore(); |
| 26 | 30 |
| 27 // The client app draws the client area. Make ours totally transparent so | 31 // The client app draws the client area. Make ours totally transparent so |
| 28 // we only see the client app's client area. | 32 // we only see the client app's client area. |
| 29 canvas->FillRect(GetBoundsForClientView(), SK_ColorBLACK, | 33 canvas->FillRect(GetBoundsForClientView(), SK_ColorBLACK, |
| 30 SkBlendMode::kClear); | 34 SkBlendMode::kClear); |
| 31 } | 35 } |
| 32 | 36 |
| 33 void CustomFrameViewMus::PaintChildren(const ui::PaintContext& context) { | 37 void CustomFrameViewMus::PaintChildren(const ui::PaintContext& context) { |
| 34 CustomFrameViewAsh::PaintChildren(context); | 38 CustomFrameViewAsh::PaintChildren(context); |
| 35 // The client app draws the client area. Make ours totally transparent so | 39 // The client app draws the client area. Make ours totally transparent so |
| 36 // we only see the client apps client area. | 40 // we only see the client apps client area. |
| 37 ui::PaintRecorder recorder(context, size(), &paint_cache_); | 41 ui::PaintRecorder recorder(context, size(), &paint_cache_); |
| 38 recorder.canvas()->FillRect(GetBoundsForClientView(), SK_ColorBLACK, | 42 recorder.canvas()->FillRect(GetBoundsForClientView(), SK_ColorBLACK, |
| 39 SkBlendMode::kClear); | 43 SkBlendMode::kClear); |
| 40 } | 44 } |
| 41 | 45 |
| 42 } // namespace mus | 46 } // namespace mus |
| 43 } // namespace ash | 47 } // namespace ash |
| OLD | NEW |