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

Unified Diff: components/mus/example/wm/non_client_frame_view_impl.h

Issue 1419793006: Makes windowmanager draw non-client area (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move wm nonclientframeview to wm Created 5 years, 1 month 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: components/mus/example/wm/non_client_frame_view_impl.h
diff --git a/components/mus/example/wm/non_client_frame_view_impl.h b/components/mus/example/wm/non_client_frame_view_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..b5a9d319352d7b857c66c080d667ec2d0c6c9fa6
--- /dev/null
+++ b/components/mus/example/wm/non_client_frame_view_impl.h
@@ -0,0 +1,37 @@
+// Copyright 2015 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 COMPONENTS_MUS_EXAMPLE_WM_NON_CLIENT_FRAME_VIEW_IMPL_H_
+#define COMPONENTS_MUS_EXAMPLE_WM_NON_CLIENT_FRAME_VIEW_IMPL_H_
+
+#include "base/macros.h"
+#include "components/mus/public/cpp/window_observer.h"
+#include "ui/compositor/paint_cache.h"
+#include "ui/views/window/custom_frame_view.h"
+
+class NonClientFrameViewImpl : public views::CustomFrameView,
+ public mus::WindowObserver {
+ public:
+ explicit NonClientFrameViewImpl(mus::Window* window);
+ ~NonClientFrameViewImpl() override;
+
+ private:
+ // CustomFrameView:
+ gfx::Rect GetBoundsForClientView() const override;
+ void OnPaint(gfx::Canvas* canvas) override;
+ void PaintChildren(const ui::PaintContext& context) override;
+
+ // mus::WindowObserver:
+ void OnWindowClientAreaChanged(mus::Window* window,
+ const gfx::Insets& old_client_area) override;
+ void OnWindowDestroyed(mus::Window* window) override;
+
+ private:
+ mus::Window* window_;
+ ui::PaintCache paint_cache_;
+
+ DISALLOW_COPY_AND_ASSIGN(NonClientFrameViewImpl);
+};
+
+#endif // COMPONENTS_MUS_EXAMPLE_WM_NON_CLIENT_FRAME_VIEW_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698