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

Unified Diff: mash/wm/frame/non_client_frame_view_mash.h

Issue 1459653002: Gets mustash frames looking like that of ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update test 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
« no previous file with comments | « mash/wm/frame/move_loop_unittest.cc ('k') | mash/wm/frame/non_client_frame_view_mash.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wm/frame/non_client_frame_view_mash.h
diff --git a/mash/wm/frame/non_client_frame_view_mash.h b/mash/wm/frame/non_client_frame_view_mash.h
new file mode 100644
index 0000000000000000000000000000000000000000..31b6880288c390250ec50f2fd66711b0ac50f2e2
--- /dev/null
+++ b/mash/wm/frame/non_client_frame_view_mash.h
@@ -0,0 +1,107 @@
+// 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 MASH_WM_FRAME_NON_CLIENT_FRAME_VIEW_MASH_H_
+#define MASH_WM_FRAME_NON_CLIENT_FRAME_VIEW_MASH_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "components/mus/public/cpp/window_observer.h"
+#include "third_party/skia/include/core/SkColor.h"
+#include "ui/compositor/paint_cache.h"
+#include "ui/views/window/non_client_view.h"
+
+namespace gfx {
+class Insets;
+}
+
+namespace mus {
+class Window;
+}
+
+namespace views {
+class Widget;
+}
+
+namespace mash {
+namespace wm {
+
+class FrameCaptionButtonContainerView;
+class MoveLoop;
+
+class NonClientFrameViewMash : public views::NonClientFrameView,
+ public mus::WindowObserver {
+ public:
+ // Internal class name.
+ static const char kViewClassName[];
+
+ NonClientFrameViewMash(views::Widget* frame, mus::Window* window);
+ ~NonClientFrameViewMash() override;
+
+ static gfx::Insets GetPreferredClientAreaInsets();
+
+ // Sets the active and inactive frame colors. Note the inactive frame color
+ // will have some transparency added when the frame is drawn.
+ void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color);
+
+ // views::NonClientFrameView:
+ gfx::Rect GetBoundsForClientView() const override;
+ gfx::Rect GetWindowBoundsForClientBounds(
+ const gfx::Rect& client_bounds) const override;
+ int NonClientHitTest(const gfx::Point& point) override;
+ void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override;
+ void ResetWindowControls() override;
+ void UpdateWindowIcon() override;
+ void UpdateWindowTitle() override;
+ void SizeConstraintsChanged() override;
+
+ // views::View:
+ void Layout() override;
+ gfx::Size GetPreferredSize() const override;
+ const char* GetClassName() const override;
+ gfx::Size GetMinimumSize() const override;
+ gfx::Size GetMaximumSize() const override;
+ void OnPaint(gfx::Canvas* canvas) override;
+ void PaintChildren(const ui::PaintContext& context) override;
+ bool OnMousePressed(const ui::MouseEvent& event) override;
+ bool OnMouseDragged(const ui::MouseEvent& event) override;
+ void OnMouseReleased(const ui::MouseEvent& event) override;
+ void OnMouseCaptureLost() override;
+
+ // mus::WindowObserver:
+ void OnWindowClientAreaChanged(mus::Window* window,
+ const gfx::Insets& old_client_area) override;
+ void OnWindowDestroyed(mus::Window* window) override;
+
+ // Get the view of the header.
+ views::View* GetHeaderView();
+
+ private:
+ class OverlayView;
+
+ // Height from top of window to top of client area.
+ int NonClientTopBorderHeight() const;
+
+ bool StartMoveLoopIfNecessary(const ui::Event& event);
+ void ContinueMove(const ui::Event& event);
+ void StopMove();
+
+ // Not owned.
+ views::Widget* frame_;
+
+ mus::Window* window_;
+ ui::PaintCache paint_cache_;
+ scoped_ptr<MoveLoop> move_loop_;
+
+ // View which contains the title and window controls.
+ class HeaderView;
+ HeaderView* header_view_;
+
+ DISALLOW_COPY_AND_ASSIGN(NonClientFrameViewMash);
+};
+
+} // namespace wm
+} // namespace mash
+
+#endif // MASH_WM_FRAME_NON_CLIENT_FRAME_VIEW_MASH_H_
« no previous file with comments | « mash/wm/frame/move_loop_unittest.cc ('k') | mash/wm/frame/non_client_frame_view_mash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698