Chromium Code Reviews| Index: ash/mus/frame/custom_frame_view_mus.cc |
| diff --git a/ash/mus/frame/custom_frame_view_mus.cc b/ash/mus/frame/custom_frame_view_mus.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c5821e510d2e6bb616fd73856e43f3881f600c95 |
| --- /dev/null |
| +++ b/ash/mus/frame/custom_frame_view_mus.cc |
| @@ -0,0 +1,43 @@ |
| +// 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. |
| + |
| +#include "ash/mus/frame/custom_frame_view_mus.h" |
| + |
| +#include "ui/compositor/paint_cache.h" |
| +#include "ui/compositor/paint_recorder.h" |
| +#include "ui/gfx/canvas.h" |
| + |
| +namespace ash { |
| +namespace mus { |
| + |
| +CustomFrameViewMus::CustomFrameViewMus( |
| + views::Widget* widget, |
| + ImmersiveFullscreenControllerDelegate* immersive_delegate, |
| + bool enable_immersive) |
| + : CustomFrameViewAsh(widget, immersive_delegate, enable_immersive) {} |
| + |
| +CustomFrameViewMus::~CustomFrameViewMus() {} |
| + |
| +void CustomFrameViewMus::OnPaint(gfx::Canvas* canvas) { |
| + canvas->Save(); |
| + CustomFrameViewAsh::OnPaint(canvas); |
| + canvas->Restore(); |
| + |
| + // The client app draws the client area. Make ours totally transparent so |
| + // we only see the client apps client area. |
|
James Cook
2016/08/24 17:00:32
super nit: apps -> app's
sky
2016/08/24 19:23:28
Done.
|
| + canvas->FillRect(GetBoundsForClientView(), SK_ColorBLACK, |
|
James Cook
2016/08/24 17:00:32
Dumb question: Why is this SK_ColorBLACK? How does
sky
2016/08/24 19:23:29
Not a dumb question. This should be kClear_Mode. F
|
| + SkXfermode::kSrc_Mode); |
| +} |
| + |
| +void CustomFrameViewMus::PaintChildren(const ui::PaintContext& context) { |
| + CustomFrameViewAsh::PaintChildren(context); |
| + // The client app draws the client area. Make ours totally transparent so |
| + // we only see the client apps client area. |
| + ui::PaintRecorder recorder(context, size(), &paint_cache_); |
| + recorder.canvas()->FillRect(GetBoundsForClientView(), SK_ColorBLACK, |
| + SkXfermode::kSrc_Mode); |
| +} |
| + |
| +} // namespace mus |
| +} // namespace ash |