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