| 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_DIALOG_FRAME_VIEW_H_ | 5 #ifndef UI_VIEWS_WINDOW_DIALOG_FRAME_VIEW_H_ |
| 6 #define ASH_WM_DIALOG_FRAME_VIEW_H_ | 6 #define UI_VIEWS_WINDOW_DIALOG_FRAME_VIEW_H_ |
| 7 | 7 |
| 8 #include "ui/views/controls/button/button.h" | 8 #include "ui/views/controls/button/button.h" |
| 9 #include "ui/views/window/non_client_view.h" | 9 #include "ui/views/window/non_client_view.h" |
| 10 | 10 |
| 11 namespace gfx { | 11 namespace gfx { |
| 12 class Font; | 12 class Font; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace views { | 15 namespace views { |
| 16 |
| 16 class ImageButton; | 17 class ImageButton; |
| 17 } | |
| 18 | 18 |
| 19 namespace ash { | 19 // A NonClientFrameView that implements a new-style for dialogs. |
| 20 namespace internal { | 20 class VIEWS_EXPORT DialogFrameView : public NonClientFrameView, |
| 21 | 21 public ButtonListener { |
| 22 // A NonClientFrameView that implements a Google-style for dialogs. | |
| 23 class DialogFrameView : public views::NonClientFrameView, | |
| 24 public views::ButtonListener { | |
| 25 public: | 22 public: |
| 26 // Internal class name. | 23 // Internal class name. |
| 27 static const char kViewClassName[]; | 24 static const char kViewClassName[]; |
| 28 | 25 |
| 29 DialogFrameView(); | 26 DialogFrameView(); |
| 30 virtual ~DialogFrameView(); | 27 virtual ~DialogFrameView(); |
| 31 | 28 |
| 32 // Overridden from views::NonClientFrameView: | 29 // Overridden from NonClientFrameView: |
| 33 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; | 30 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; |
| 34 virtual gfx::Rect GetWindowBoundsForClientBounds( | 31 virtual gfx::Rect GetWindowBoundsForClientBounds( |
| 35 const gfx::Rect& client_bounds) const OVERRIDE; | 32 const gfx::Rect& client_bounds) const OVERRIDE; |
| 36 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; | 33 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; |
| 37 virtual void GetWindowMask(const gfx::Size& size, | 34 virtual void GetWindowMask(const gfx::Size& size, |
| 38 gfx::Path* window_mask) OVERRIDE; | 35 gfx::Path* window_mask) OVERRIDE; |
| 39 virtual void ResetWindowControls() OVERRIDE; | 36 virtual void ResetWindowControls() OVERRIDE; |
| 40 virtual void UpdateWindowIcon() OVERRIDE; | 37 virtual void UpdateWindowIcon() OVERRIDE; |
| 41 virtual void UpdateWindowTitle() OVERRIDE; | 38 virtual void UpdateWindowTitle() OVERRIDE; |
| 42 | 39 |
| 43 // Overridden from View: | 40 // Overridden from View: |
| 44 virtual std::string GetClassName() const OVERRIDE; | 41 virtual std::string GetClassName() const OVERRIDE; |
| 45 virtual void Layout() OVERRIDE; | 42 virtual void Layout() OVERRIDE; |
| 46 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 43 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
| 47 | 44 |
| 48 // Overridden from views::ButtonListener: | 45 // Overridden from ButtonListener: |
| 49 virtual void ButtonPressed(views::Button* sender, | 46 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE; |
| 50 const ui::Event& event) OVERRIDE; | |
| 51 | 47 |
| 52 private: | 48 private: |
| 53 gfx::Insets GetPaddingInsets() const; | 49 gfx::Insets GetPaddingInsets() const; |
| 54 gfx::Insets GetClientInsets() const; | 50 gfx::Insets GetClientInsets() const; |
| 55 | 51 |
| 56 scoped_ptr<gfx::Font> title_font_; | 52 scoped_ptr<gfx::Font> title_font_; |
| 57 gfx::Rect title_display_rect_; | 53 gfx::Rect title_display_rect_; |
| 58 | 54 |
| 59 views::ImageButton* close_button_; | 55 ImageButton* close_button_; |
| 60 | 56 |
| 61 DISALLOW_COPY_AND_ASSIGN(DialogFrameView); | 57 DISALLOW_COPY_AND_ASSIGN(DialogFrameView); |
| 62 }; | 58 }; |
| 63 | 59 |
| 64 } // namespace internal | |
| 65 } // namespace views | 60 } // namespace views |
| 66 | 61 |
| 67 #endif // ASH_WM_DIALOG_FRAME_VIEW_H_ | 62 #endif // UI_VIEWS_WINDOW_DIALOG_FRAME_VIEW_H_ |
| OLD | NEW |