OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_WM_PANEL_FRAME_VIEW_H_ | 5 #ifndef ASH_WM_PANEL_FRAME_VIEW_H_ |
6 #define ASH_WM_PANEL_FRAME_VIEW_H_ | 6 #define ASH_WM_PANEL_FRAME_VIEW_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/aura/aura_export.h" | 10 #include "ui/aura/aura_export.h" |
| 11 #include "ui/gfx/font.h" |
11 #include "ui/views/window/non_client_view.h" | 12 #include "ui/views/window/non_client_view.h" |
12 #include "ui/views/controls/button/button.h" // ButtonListener | 13 #include "ui/views/controls/button/button.h" // ButtonListener |
13 | 14 |
14 namespace views { | 15 namespace views { |
15 class ImageButton; | 16 class ImageButton; |
16 } | 17 } |
17 | 18 |
18 namespace ash { | 19 namespace ash { |
19 | 20 |
20 class FramePainter; | 21 class FramePainter; |
21 | 22 |
22 class ASH_EXPORT PanelFrameView : public views::NonClientFrameView, | 23 class ASH_EXPORT PanelFrameView : public views::NonClientFrameView, |
23 public views::ButtonListener { | 24 public views::ButtonListener { |
24 public: | 25 public: |
25 enum FrameType { | 26 enum FrameType { |
26 FRAME_NONE, | 27 FRAME_NONE, |
27 FRAME_ASH | 28 FRAME_ASH |
28 }; | 29 }; |
29 | 30 |
30 PanelFrameView(views::Widget* frame, FrameType frame_type); | 31 PanelFrameView(views::Widget* frame, FrameType frame_type); |
31 virtual ~PanelFrameView(); | 32 virtual ~PanelFrameView(); |
32 | 33 |
33 private: | 34 private: |
34 void InitFramePainter(views::Widget* frame); | 35 void InitFramePainter(); |
35 | 36 |
36 // Overridden from views::NonClientFrameView: | 37 // Overridden from views::NonClientFrameView: |
37 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | 38 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; |
38 virtual gfx::Rect GetWindowBoundsForClientBounds( | 39 virtual gfx::Rect GetWindowBoundsForClientBounds( |
39 const gfx::Rect& client_bounds) const OVERRIDE; | 40 const gfx::Rect& client_bounds) const OVERRIDE; |
40 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | 41 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; |
41 virtual void GetWindowMask(const gfx::Size& size, | 42 virtual void GetWindowMask(const gfx::Size& size, |
42 gfx::Path* window_mask) OVERRIDE; | 43 gfx::Path* window_mask) OVERRIDE; |
43 virtual void ResetWindowControls() OVERRIDE; | 44 virtual void ResetWindowControls() OVERRIDE; |
44 virtual void UpdateWindowIcon() OVERRIDE; | 45 virtual void UpdateWindowIcon() OVERRIDE; |
45 virtual void UpdateWindowTitle() OVERRIDE; | 46 virtual void UpdateWindowTitle() OVERRIDE; |
46 | 47 |
47 // Overridden from views::View: | 48 // Overridden from views::View: |
48 virtual void Layout() OVERRIDE; | 49 virtual void Layout() OVERRIDE; |
49 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 50 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
50 | 51 |
51 // Overridden from views::ButtonListener: | 52 // Overridden from views::ButtonListener: |
52 virtual void ButtonPressed(views::Button* sender, | 53 virtual void ButtonPressed(views::Button* sender, |
53 const ui::Event& event) OVERRIDE; | 54 const ui::Event& event) OVERRIDE; |
54 | 55 |
55 // Child View class describing the panel's title bar behavior | 56 // Child View class describing the panel's title bar behavior |
56 // and buttons, owned by the view hierarchy | 57 // and buttons, owned by the view hierarchy |
57 scoped_ptr<FramePainter> frame_painter_; | 58 scoped_ptr<FramePainter> frame_painter_; |
| 59 views::Widget* frame_; |
58 views::ImageButton* close_button_; | 60 views::ImageButton* close_button_; |
59 views::ImageButton* minimize_button_; | 61 views::ImageButton* minimize_button_; |
| 62 views::ImageButton* window_icon_; |
60 gfx::Rect client_view_bounds_; | 63 gfx::Rect client_view_bounds_; |
| 64 const gfx::Font title_font_; |
61 | 65 |
62 DISALLOW_COPY_AND_ASSIGN(PanelFrameView); | 66 DISALLOW_COPY_AND_ASSIGN(PanelFrameView); |
63 }; | 67 }; |
64 | 68 |
65 } | 69 } |
66 | 70 |
67 #endif // ASH_WM_PANEL_FRAME_VIEW_H_ | 71 #endif // ASH_WM_PANEL_FRAME_VIEW_H_ |
OLD | NEW |