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