| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_COMMON_WM_PANELS_PANEL_FRAME_VIEW_H_ | |
| 6 #define ASH_COMMON_WM_PANELS_PANEL_FRAME_VIEW_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 | |
| 10 #include "ash/ash_export.h" | |
| 11 #include "ash/common/shell_observer.h" | |
| 12 #include "base/macros.h" | |
| 13 #include "ui/views/window/non_client_view.h" | |
| 14 | |
| 15 namespace views { | |
| 16 class ImageView; | |
| 17 } | |
| 18 | |
| 19 namespace ash { | |
| 20 class DefaultHeaderPainter; | |
| 21 class FrameCaptionButtonContainerView; | |
| 22 | |
| 23 class ASH_EXPORT PanelFrameView : public views::NonClientFrameView, | |
| 24 public ShellObserver { | |
| 25 public: | |
| 26 // Internal class name. | |
| 27 static const char kViewClassName[]; | |
| 28 | |
| 29 enum FrameType { FRAME_NONE, FRAME_ASH }; | |
| 30 | |
| 31 PanelFrameView(views::Widget* frame, FrameType frame_type); | |
| 32 ~PanelFrameView() override; | |
| 33 | |
| 34 // Sets the active and inactive frame colors. Note the inactive frame color | |
| 35 // will have some transparency added when the frame is drawn. | |
| 36 void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); | |
| 37 | |
| 38 // views::View: | |
| 39 const char* GetClassName() const override; | |
| 40 | |
| 41 private: | |
| 42 void InitHeaderPainter(); | |
| 43 | |
| 44 WmWindow* GetWidgetWindow(); | |
| 45 | |
| 46 // Height from top of window to top of client area. | |
| 47 int NonClientTopBorderHeight() const; | |
| 48 | |
| 49 // views::NonClientFrameView: | |
| 50 gfx::Rect GetBoundsForClientView() const override; | |
| 51 gfx::Rect GetWindowBoundsForClientBounds( | |
| 52 const gfx::Rect& client_bounds) const override; | |
| 53 int NonClientHitTest(const gfx::Point& point) override; | |
| 54 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override; | |
| 55 void ResetWindowControls() override; | |
| 56 void UpdateWindowIcon() override; | |
| 57 void UpdateWindowTitle() override; | |
| 58 void SizeConstraintsChanged() override; | |
| 59 | |
| 60 // views::View: | |
| 61 gfx::Size GetMinimumSize() const override; | |
| 62 void Layout() override; | |
| 63 void OnPaint(gfx::Canvas* canvas) override; | |
| 64 | |
| 65 // ShellObserver: | |
| 66 void OnOverviewModeStarting() override; | |
| 67 void OnOverviewModeEnded() override; | |
| 68 | |
| 69 // Child View class describing the panel's title bar behavior | |
| 70 // and buttons, owned by the view hierarchy | |
| 71 views::Widget* frame_; | |
| 72 FrameCaptionButtonContainerView* caption_button_container_; | |
| 73 views::ImageView* window_icon_; | |
| 74 gfx::Rect client_view_bounds_; | |
| 75 | |
| 76 // Helper class for painting the header. | |
| 77 std::unique_ptr<DefaultHeaderPainter> header_painter_; | |
| 78 | |
| 79 DISALLOW_COPY_AND_ASSIGN(PanelFrameView); | |
| 80 }; | |
| 81 } | |
| 82 | |
| 83 #endif // ASH_COMMON_WM_PANELS_PANEL_FRAME_VIEW_H_ | |
| OLD | NEW |