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

Side by Side Diff: ash/wm/panels/panel_frame_view.h

Issue 2410633002: Moves PanelFrameView to common (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « ash/shell/panel_window.cc ('k') | ash/wm/panels/panel_frame_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_WM_PANELS_PANEL_FRAME_VIEW_H_
6 #define ASH_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 // Height from top of window to top of client area.
45 int NonClientTopBorderHeight() const;
46
47 // views::NonClientFrameView:
48 gfx::Rect GetBoundsForClientView() const override;
49 gfx::Rect GetWindowBoundsForClientBounds(
50 const gfx::Rect& client_bounds) const override;
51 int NonClientHitTest(const gfx::Point& point) override;
52 void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override;
53 void ResetWindowControls() override;
54 void UpdateWindowIcon() override;
55 void UpdateWindowTitle() override;
56 void SizeConstraintsChanged() override;
57
58 // views::View:
59 gfx::Size GetMinimumSize() const override;
60 void Layout() override;
61 void OnPaint(gfx::Canvas* canvas) override;
62
63 // ShellObserver:
64 void OnOverviewModeStarting() override;
65 void OnOverviewModeEnded() override;
66
67 // Child View class describing the panel's title bar behavior
68 // and buttons, owned by the view hierarchy
69 views::Widget* frame_;
70 FrameCaptionButtonContainerView* caption_button_container_;
71 views::ImageView* window_icon_;
72 gfx::Rect client_view_bounds_;
73
74 // Helper class for painting the header.
75 std::unique_ptr<DefaultHeaderPainter> header_painter_;
76
77 DISALLOW_COPY_AND_ASSIGN(PanelFrameView);
78 };
79 }
80
81 #endif // ASH_WM_PANELS_PANEL_FRAME_VIEW_H_
OLDNEW
« no previous file with comments | « ash/shell/panel_window.cc ('k') | ash/wm/panels/panel_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698