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_CUSTOM_FRAME_VIEW_ASH_H_ | 5 #ifndef ASH_WM_CUSTOM_FRAME_VIEW_ASH_H_ |
6 #define ASH_WM_CUSTOM_FRAME_VIEW_ASH_H_ | 6 #define ASH_WM_CUSTOM_FRAME_VIEW_ASH_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "ui/views/controls/button/button.h" // ButtonListener | 10 #include "ui/views/controls/button/button.h" // ButtonListener |
11 #include "ui/views/window/non_client_view.h" | 11 #include "ui/views/window/non_client_view.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
14 class FramePainter; | 14 class FramePainter; |
15 class FrameMaximizeButton; | |
16 } | 15 } |
17 namespace gfx { | 16 namespace gfx { |
18 class Font; | 17 class Font; |
19 } | 18 } |
20 namespace views { | 19 namespace views { |
21 class ImageButton; | 20 class ImageButton; |
22 class Widget; | 21 class Widget; |
23 } | 22 } |
24 | 23 |
25 namespace ash { | 24 namespace ash { |
26 | 25 |
27 // A NonClientFrameView used for dialogs and other non-browser windows. | 26 // A NonClientFrameView used for dialogs and other non-browser windows. |
28 // See also views::CustomFrameView and BrowserNonClientFrameViewAsh. | 27 // See also views::CustomFrameView and BrowserNonClientFrameViewAsh. |
29 class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView, | 28 class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView, |
30 public views::ButtonListener { | 29 public views::ButtonListener { |
31 public: | 30 public: |
32 // Internal class name. | 31 // Internal class name. |
33 static const char kViewClassName[]; | 32 static const char kViewClassName[]; |
34 | 33 |
35 CustomFrameViewAsh(); | 34 CustomFrameViewAsh(); |
36 virtual ~CustomFrameViewAsh(); | 35 virtual ~CustomFrameViewAsh(); |
37 | 36 |
38 // For testing. | 37 // For testing. |
39 class TestApi { | 38 class TestApi { |
40 public: | 39 public: |
41 explicit TestApi(CustomFrameViewAsh* frame) : frame_(frame) { | 40 explicit TestApi(CustomFrameViewAsh* frame) : frame_(frame) { |
42 } | 41 } |
43 | 42 |
44 ash::FrameMaximizeButton* maximize_button() const { | 43 views::ImageButton* maximize_button() const { |
45 return frame_->maximize_button_; | 44 return frame_->maximize_button_; |
46 } | 45 } |
47 | 46 |
48 private: | 47 private: |
49 TestApi(); | 48 TestApi(); |
50 CustomFrameViewAsh* frame_; | 49 CustomFrameViewAsh* frame_; |
51 }; | 50 }; |
52 | 51 |
53 void Init(views::Widget* frame); | 52 void Init(views::Widget* frame); |
54 | 53 |
(...skipping 20 matching lines...) Expand all Loading... |
75 virtual void ButtonPressed(views::Button* sender, | 74 virtual void ButtonPressed(views::Button* sender, |
76 const ui::Event& event) OVERRIDE; | 75 const ui::Event& event) OVERRIDE; |
77 | 76 |
78 private: | 77 private: |
79 // Height from top of window to top of client area. | 78 // Height from top of window to top of client area. |
80 int NonClientTopBorderHeight() const; | 79 int NonClientTopBorderHeight() const; |
81 | 80 |
82 // Not owned. | 81 // Not owned. |
83 views::Widget* frame_; | 82 views::Widget* frame_; |
84 | 83 |
85 ash::FrameMaximizeButton* maximize_button_; | 84 views::ImageButton* maximize_button_; |
86 views::ImageButton* close_button_; | 85 views::ImageButton* close_button_; |
87 views::ImageButton* window_icon_; | 86 views::ImageButton* window_icon_; |
88 | 87 |
89 scoped_ptr<FramePainter> frame_painter_; | 88 scoped_ptr<FramePainter> frame_painter_; |
90 | 89 |
91 DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAsh); | 90 DISALLOW_COPY_AND_ASSIGN(CustomFrameViewAsh); |
92 }; | 91 }; |
93 | 92 |
94 } // namespace ash | 93 } // namespace ash |
95 | 94 |
96 #endif // ASH_WM_CUSTOM_FRAME_VIEW_ASH_H_ | 95 #endif // ASH_WM_CUSTOM_FRAME_VIEW_ASH_H_ |
OLD | NEW |