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

Unified Diff: ash/mus/frame/custom_frame_view_mus.cc

Issue 2277563002: Wires up immersive mode for chrome and mash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 4 years, 4 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
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..37bc60c24bed1544ccd4c2a6e89c7936bbfc159c
--- /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 app's client area.
+ canvas->FillRect(GetBoundsForClientView(), SK_ColorBLACK,
+ SkXfermode::kClear_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::kClear_Mode);
+}
+
+} // namespace mus
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698